Ask Java Expert


Home >> Java

QUESTION 1 Give two examples of Operating Systems.

QUESTION 2 Unicode is a world standard to represent _________________

QUESTION 3 Java is a high-level language
True
False

QUESTION 4 Java is an object-oriented language.

True
False

QUESTION 5You have successfully compiled the file Hi.java, how do you run the corresponding program from the command line?
a. java Hi.java
b. java Hi.class
c. java Hi
d. Hi
e. Hi.class

QUESTION 6 A double is more precise than a float.

True
False

QUESTION 7 char values are surrounded by _____ quotes

QUESTION 8  String literals are surrounded by _____ quotes

QUESTION 9 The result of 3.0 / 2 is _________________ .


a. 1
b. 1.5
c. 3
d. 2
e. 0

QUESTION 10 If you have written the following source code:
public class SpringBreak?{? // lots of code here?}
then your source code should be saved in a file named _______________

QUESTION 11 What keyword do we use when instantiating an object _________________

a. Create
b. =
c. new
d. Object
e. is

QUESTION 12 The operations for a class are called _____

QUESTION 13 The special method that we call when instantiating an object is called a _____

QUESTION 14 Write Java statements to instantiate a random number generator object and generate a random integer between 100 and 250 (inclusive).

QUESTION 15 Complete this code in main to perform the requested operations for a date entered by the user in this format: month dd, yyyy

public static void main( String [] args )
{
Scanner scan = new Scanner( System.in );
System.out.print( "Enter a date > " );
String date = scan.nextLine( );
// a. output the first letter in the month
// b. output the date in all lowercase letters
/* c. output the year portion of the date, that is, the characters in the date that follow the comma. For example, if the date is February 24, 2016, you would output 2016. (Note, your code should work for ANY date in that format.) */

QUESTION 16 Which package is the Graphics class part of? _________________ .
a. javax.swing
b. java.swing
c. java.awt
d. javax.awt
e. java.graphics

QUESTION 17 The name of the method used to set the current color is _________________

QUESTION 18 Complete the code, drawing a line between points (100, 200) and (34, 67)

public void paint( Graphics g )
{
// your code goes here
}

QUESTION 19 Complete the code, drawing a solid circle (with the current color, whatever it is) so that its diameter is 200, and the coordinates of its center are ( 250, 150 )

public void paint( Graphics g )
{
// your code goes here
}

QUESTION 20 The access modifier of constructors should be _________________

QUESTION 21 When you use a while loop to compute the product of several values, you should initialize the variables holding the product to ______ .
a. 0
b. 1
c. NULL
d. There is no need to initialize it

QUESTION 22 When a loop condition is grade >= 90, what values would you use to test your loop?
a. 88 and 89
b. 0 and 90
c. 89, 90, and 91
d. 90, 91, and 92

QUESTION 23 What is the output of this code sequence?

for ( int i = 5; i >= 0; i-- )
System.out.print( i + " " );
System.out.println( );

QUESTION 24 Write a loop to output the word EXAM 99 times

QUESTION 25 To access the number of elements in an array named grades, we use _________________ .
a. grades
b. grades.size()
c. grades.size
d. grades.length()
e. grades.length

QUESTION 26 Write the code to compute and output how many times the value 99 is found in an array of integers named numbers.

QUESTION 27 When processing all the elements of row i of a two-dimensional array named grades using a for loop with variable j, what is the condition of the for loop? _________________ .

a. j < length
b. j < grades.length
c. j <= grades.length
d. j < grades[i].length
e. j <= grades[i].length

QUESTION 28 The variable numbers is a 2-dimensional array of type int; output all of its elements that are strictly greater than 10

QUESTION 29 What is the error and why is there an error in the code below?

public class XYZ
{
public static final int A = 9;
public abstract void foo1( );
public int foo2( )
{
return 5;
}
}

QUESTION 30 When we read objects from a file using the readObject method, what happens when the end of the file is reached?

QUESTION 31 What is the output of the following sequence?
Scanner scan = new Scanner( System.in );
int number = 0;
try
{
number = scan.nextInt( ); // User enters 12, hits ENTER
System.out.println( "1: " + number );
number = scan.nextInt( ); // User enters 56, hits ENTER
System.out.println( "2: " + number );
number = scan.nextInt( ); // User enters 99ABC, hits ENTER
System.out.println( "3: " + number );
}
catch( Exception e)
{
String s = scan.nextLine( );
System.out.println( "4: " + number );
}
finally
{
number = scan.nextInt( ); // User enters 100, hits ENTER
System.out.println( "5: " + number );
}

QUESTION 32 In the BorderLayout class, what are NORTH, SOUTH, EAST, WEST, and CENTER?

QUESTION 33
Write a program that displays a text field and two buttons labeled "uppercase" and "lowercase". When the user clicks on the uppercase button, the text changes to uppercase; when the user clicks on the lowercase button, the text changes to lowercase.

Java, Programming

  • Category:- Java
  • Reference No.:- M91556515
  • Price:- $35

Priced at Now at $35, Verified Solution

Have any Question?


Related Questions in Java

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As