Question

QUESTION 1 In Java, all variables declared using a class are ____. a. reference variables b....

QUESTION 1

  1. In Java, all variables declared using a class are ____.

    a.

    reference variables

    b.

    constants

    c.

    primitive variables

    d.

    operators

1 points   

QUESTION 2

  1. An expression such as str.length(); is an example of a(n) ____.

    a.

    system call

    b.

    method call

    c.

    object call

    d.

    class

1 points   

QUESTION 3

  1. Consider the following statements.

    double x;
    String y;

    y = String.format( "%.2f", x);

    If x = 285.679, what is the value of y?

    a.

    "285.00"

    b.

    "285.680"

    c.

    "285.68"

    d.

    "285.068"

1 points   

QUESTION 4

  1. A(n) ____ is a method of a class that is automatically executed when an object of the class is created.

    a.

    constructor

    b.

    interface

    c.

    inheritance

    d.

    package

1 points   

QUESTION 5

  1. Which of the following is a reserved word in Java?

    a.

    inheritance

    b.

    extends

    c.

    event

    d.

    pane

1 points   

QUESTION 6

  1. If Shape is a class and you create a new class Rectangle that extends Shape, then Shape is a(n) ____ and Rectangle is a(n) ____.

    Which word goes in the first blank in the sentence above?

    a.

    superclass

    b.

    inherited class

    c.

    subclass

    d.

    package

1 points   

QUESTION 7

  1. Which modifier is used to build classes on top of classes that are interfaces?

    a.

    public

    b.

    implements

    c.

    new

    d.

    private

1 points   

QUESTION 8

  1. Write a program that takes as input the pay rate and hours worked of an employee and calculates the pay of the employee.

    Based on the problem statement above, which of the following would most likely be chosen as the class?

    a.

    Pay

    b.

    Hours_Worked

    c.

    Pay_Rate

    d.

    Employee

1 points   

QUESTION 9

  1. Write a program that takes as input the pay rate and hours worked of an employee and calculates the pay of the employee.

    Based on the problem statement above, which of the following would be a data member?

    a.

    job

    b.

    hoursWorked

    c.

    pay

    d.

    employee

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please Note:
I have answered the first 4 questions as per the Chegg Answering Guidelines. Please Re-post for the other Questions.

Answer)
QUESTION 1
a. reference variables - are the variables which are declared in the class.

QUESTION 2
b. method call - length() is the method which is called here, thus it is known as a method call

QUESTION 3
c. "285.68" - is the output of the above code. The value is approximated to 285.68 till 2 characters to the right

QUESTION 4
a. constructor - is such a method which is called as soon as the class object is loaded.

Add a comment
Know the answer?
Add Answer to:
QUESTION 1 In Java, all variables declared using a class are ____. a. reference variables b....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 1 1 pts Which of the following is not a valid class name in Java?...

    Question 1 1 pts Which of the following is not a valid class name in Java? O MyClass MyClass1 My_Class MyClass# Question 2 1 pts Which of the following statements is False about instance variables and methods? Instance variables are usually defined with private access modifier. Instance variables are defined inside instance methods. Instance methods are invoked on an object of the class that contains the methods. A class can have more than one instance variables and methods. Question 3...

  • Java code for the following inheritance hierarchy figure.. 1. Create class Point, with two private instance...

    Java code for the following inheritance hierarchy figure.. 1. Create class Point, with two private instance variables x and y that represented for the coordinates for a point. Provide constructor for initialising two instance variables. Provide set and get methods for each instance variable, Provide toString method to return formatted string for a point coordinates. 2. Create class Circle, its inheritance from Point. Provide a integer private radius instance variable. Provide constructor to initialise the center coordinates and radius for...

  • Using the IST Linux system create the following Java command line inheritance application Lab4. Create the...

    Using the IST Linux system create the following Java command line inheritance application Lab4. Create the following project Java files: Point.java, Shape.java, Circle.java, Triangle.java, Rectangle.java, and Lab4.java Point.java will contain two coordinates x and y. This will be reused to create point objects to draw all the shapes. Shape.java will be the parent class and will contain a Point type. Circle.java, Triangle.java, Rectangle.java will all be children of Shapes.java class Each class (Circle, Triangle, Rectangle) will contain the private class...

  • IN JAVA For the following questions, “define a class” means the following: • Create an appropriately-named...

    IN JAVA For the following questions, “define a class” means the following: • Create an appropriately-named file containing the Java class definition, including the following: – A block comment describing the file (and hence the class), as always – Any instance variables, as required by the question – Accessor (getter) and mutator (setter) methods for any instance variables – Constructors as appropriate or as required by the question – A toString method that prints instances of the class informatively –...

  • My Java code from last assignment: Previous Java code: public static void main(String args[]) { //...

    My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...

  • My Java code from last assignment: Previous Java code: public static void main(String args[]) { //...

    My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...

  • (TCO 1) The JVM executes a Java application by (Points : 6)        executing the public static...

    (TCO 1) The JVM executes a Java application by (Points : 6)        executing the public static main method of the class.        creating an object of the class and executing that object’s main method.        executing the class constructor.        compiling the Java code into byte code. (TCO 1) Which method call converts the value in variable stringVariable to a double? (Points : 6)        Double.parseDouble( stringVariable );        Convert.toDouble( stringVariable );        Convert.parseDouble( stringVariable );        Float.parseFloat( stringVariable ); (TCO 1) Which of the following can...

  • In JAVA Algorithm Workbench 1. Write the first line of the definition for a Poodle class....

    In JAVA Algorithm Workbench 1. Write the first line of the definition for a Poodle class. The class should extend the Dog class. 2. Look at the following code, which is the first line of a class definition: public class Tiger extends Felis In what order will the class constructors execute? 3. Write the statement that calls a superclass constructor and passes the arguments x, y, and z. 4. A superclass has the following method: public void setValue(int v) value...

  • (PLEASE UPLOAD ALL PARTS TO THE QUESTION) (IE: PSEUDO CODE AND JAVA CODE TOGETHER NOT ONE...

    (PLEASE UPLOAD ALL PARTS TO THE QUESTION) (IE: PSEUDO CODE AND JAVA CODE TOGETHER NOT ONE OR THE OTHER) Design an Employee class that fields for the following pieces of information: 1) Employee name 2) Employee number Next design a class named ProductionWorker that extends the Employee class. The ProductionWorker class should have fields to hold the following information: 1) Shift number (an integer, such as 1, 2, or 3) 2)Hourly pay The workday is divided into two shifts day...

  • (PLEASE UPLOAD ALL PARTS TO THE QUESTION) (IE: PSEUDO CODE AND JAVA CODE TOGETHER NOT ONE...

    (PLEASE UPLOAD ALL PARTS TO THE QUESTION) (IE: PSEUDO CODE AND JAVA CODE TOGETHER NOT ONE OR THE OTHER) Design an Employee class that fields for the following pieces of information: 1) Employee name 2) Employee number Next design a class named ProductionWorker that extends the Employee class. The ProductionWorker class should have fields to hold the following information: 1) Shift number (an integer, such as 1, 2, or 3) 2)Hourly pay The workday is divided into two shifts day...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT