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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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