The access modifier of constructors should be

Assignment Help JAVA Programming
Reference no: EM13882362

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.

Reference no: EM13882362

Questions Cloud

Develop operational plan for an organization of your choice : Develop an operational plan for an organization of your choice. Provide detailed SMART objectives and Key Performance Indicators to be achieved by your operational plan.
Prepare manufacturing overhead budget : Prepare a Production Budget and prepare a Direct Materials Purchase Budget - Prepare manufacturing Overhead Budget
Find the median monthly housing expenditure : If monthly housing expenditures were measured in hundreds of dollars, rather than in dollars, what would be the average and median expenditures?
How does the sound effects match with the plots actually : Why choose these sound effects and those sound effects and plot how to match this production at this time. How does the sound effects match with the plots actually
The access modifier of constructors should be : The access modifier of constructors should be
Do you think cities approaches could work in united states : Cities and their governments in places like Freiburg and Curitiba are heavily involved in creating a more sustainable urban fabric by implementing proactive policies and regulations. Do you think their approaches could work in the United States?
Thomson model of the atom : Thomson's Model of the Atom Continued. Using Thomson's (outdated) model of the atom described in Problem, consider an atom consisting of two electrons, each of charge -e, embedded in a sphere of charge + 2e and radius R. In equilibrium, each elect..
Find the probability that the jury had at least one member : Find the probability that the jury had at least one member who believed in Simpson's innocence prior to jury selection. [Hint: Define the Binomial(12,.20) random vari- able X to be the number of jurors believing in Simpson's innocence.]
How can the marketing department address this issue : American Theater has occurred out of laziness--in that is is easier to sell a "product" which is comfortable and familiar to audiences--or necessity: the fear that an audience will not attend a theatrical "product" which is unknown? How can the ma..

Reviews

Write a Review

JAVA Programming Questions & Answers

  What are the concerns about how java implements arrays

What are the concerns about how Java implements arrays? What are your concerns? In Java, what is the starting index of an array

  Program that lets the user enter four quarterly sales

The figures should be stored in a two-dimensional array. Once the figures arc entered, the program should display the following data for each quarter:

  Design a small wbis using elements from the disciplines

Design a small WBIS using elements from the disciplines of web design, database design, software engineering and object modelling;be able to develop a small WBIS using HTML forms, Java Servlets and cookies.

  Methods are commonly used to break a problem down into

methods are commonly used to break a problem down into small manageable pieces. a large task can be broken down into

  Need a console program

Need a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed).

  The frantic pipe layer game

Design the Frantic Pipe Layer game

  Write down a java gui application index2java based on the

write a java gui application index2.java based on the program in step 1 that inputs several lines of text and uses

  Compare and contrast the safavid and ottoman empires

How did the creation of the Janissary system shape the development of the Ottoman Empire? What precipitated the decline of the Ottoman Empire? Compare and contrast the Safavid and Ottoman empires?

  Representing a topographic map

Consider a grid of size N x N that represents a topographic map. Each tile describes the characteristics of its terrain, which could be of two types: normal or mountainous. ROBBIE the robot must navigate from a starting position (xs, ys) to a goal..

  Write a program that reads a set of floating-point

Write a program that reads a set of floating-point data values from the input.

  Create a data set with 100 integer values.

Create a data set with 100 integer values. Create a program that uses the division method of hashing to store the data values into hash tables with table sizes of 7,,51 and 151. Use the linear probing method of collision resolution. Print out the ..

  Write a program to track hourly employee arrival departure

THE JAVA SOURCE CODEWILL AWARD AN ADDITIONAL 1,500 POINTS TO PERSON WITH THE BEST ANSWER (you will be directed to another one of my previous, unanswered questions.)A company hires you to write a program to track hourly employee arrival and departure ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd