What is the name for the circled items

Assignment Help Other Subject
Reference no: EM13764822

Question 1. What two categories of variables can classes define?

Instance and core variables

Volatile and non-volatile variables

Instance and class variables

Inheritance and class variables

Question 3. Which statement shows the correct way to declare and initialize a named constant that represents absolute zero?

final int absoluteZero = -273.15;

final double absoluteZero = -273.15;

final int ABSOLUTE_ZERO = -273.15;

final double ABSOLUTE_ZERO = -273.15;

Question 4.4. In the following class:

public class Height

{

private double height;

private String unitsOfMeasurement;

//************************

public Height()

{

this.unitsOfMeasurement = "in";

}

public void setHeight(double height)

{

this.height = height;

this.unitsOfMeasurement = "cm";

}

public void setHeight(double height, String unitsOfMeasurement)

{

this.height = height;

this.unitsOfMeasurement = unitsOfMeasurement;

}

public void print()

{

System.out.println(this.height + " " + this.unitsOfMeasurement);

}

} // end class Height

Which method is the constructor? (Points : 1)

The print method

The Height method

The setHeight method

This class does not implement a constructor.

Question 5. Java primitive types include _________.

integer, double, string, boolean, long and float

integer, double, float, array, boolean and long

long, integer, string, array, float, double and character

long, double, character, float, integer and boolean

Question 6. What is the name for the circled items in the following statement? What is the name for the circled items in the following statement?

modulus specifier

format specifier

flags specifier

precision specifier

Question 7. Which Java operator is used for concatenation?

&&

+

.

||

What will display on the screen for mazdaCar's year when mazdaCar executes printYear()?

2008

2010

2011

Black

Question 9. Given the following method from a class:

...

public double calculateArea(double length, double width)

{ double area; area = length * width; return area; return area;

}

...

What is the scope of the variables length and width?

Global to the class.

Local to the method.

Global to all objects created from the class.

None of the above.

Question 10. In the following code fragment:

...

5 Person person1 = new Person();

6 Person person2 = new Person();

8 person1.setName("Bugs Bunny");

9 person2.setName("Daffy Duck");

10 System.out.println(person1.getName() + ", " + person2.getName());

12 person1.swapPerson(person2);

13 System.out.println(person1.getName() + ", " + person2.getName());

...

What is being passed to the swapPerson method in line 12:

an object

an object reference

a class

a class reference

Question 11. In the following Java code fragment:

...

int postion1 = 15;

int postion2 = 18;

int distanceApart =

Math.abs(position1 - position2);

...

What type of method is the Math.abs() method?

Instance method

Class method

Final method

Inherited method

Question 12. When a public method needs to access both class members (variables and methods) and instance members (variables and methods), the method must be a / an _________ method.

instance

helper

class

None of the above.

Question 13. In the following class:

public class Height

{

private double height;

private String unitsOfMeasurement;

public Height()

{

this.unitsOfMeasurement = "in";

}

public void setHeight(double height)

{

this.height = height;

this.unitsOfMeasurement = "cm";

}

public void setHeight(double height, String unitsOfMeasurement)

{

this.height = height;

this.unitsOfMeasurement = unitsOfMeasurement;

}

public void print()

{

System.out.println(this.height + " " + this.unitsOfMeasurement);

}

} // end class Height

Which method is overloaded? (Points : 1)

The print method

The Height method

The setHeight method

None of the methods are overloaded.

Question 14. What must a method return if the method implements method call chaining?

The calling object

Reference no: EM13764822

Questions Cloud

Problem based on nanotechnology : Discuss current or future applications of nanotechnology in fields such as medicine, engineering, space exploration, fuel cell development, air and water purification, and agriculture.
What basis could there be a claim of fraud against seinfelds : On what basis could there be a claim of fraud against the Seinfelds, Did the realtor live up to her contractual obligations to the Seinfelds? Why or Why not
Analog and digital comparison paper : Consider how the information presented in each assignment applies to your chosen Virtual Organization.
Calculate the net present value of investment : 1. Calculate the net present value of this investment. 2. Calculate the accrual accounting rate of return on initial investment for this project.
What is the name for the circled items : What is the name for the circled items in the following statement. What is the name for the circled items in the following statement
Explain what they mean in nicks healing process : Select three symbols from Hemingway's "The Big Two-Hearted River" and explain what they mean in Nick's healing process.
Describe the components of the criminal justice system : Describe the components of the criminal justice system and the criminal justice process. Identify the goals of the criminal justice system
Philosophy of caring issues : Describe the historical background of the development of the model or framework.
What is the expected return on a portfolio : What is the expected return on a portfolio that is equally invested in the two assets and if a portfolio of the two assets has a beta of 1.1, what are the portfolio weights?

Reviews

Write a Review

Other Subject Questions & Answers

  Sociological imagination-unemployment

In regards to one's sociological imagination, discuss being unemployed and the impact of unemployment as a broader social issue.

  Organized religion

1. Organized religion" by definition reinforces the subordination of women to men.

  Most homogeneous and self-consciously international

1. According to Ellwood, which of the following faiths is the most homogeneous and self-consciously international community?

  Alzheimer disease relating to age of course

We all know that Alzheimer's disease is relate to age of course, but what is that relationship and is there an explanation for it?

  What is an isograd and reflection and refraction

Describe the way in which magmas can change their composition in Fractional Crystallization? Fine grained sedimentary rocks are formed from deposits that are (near to/ far from) the source rock. Rounded sedimentary grains represent (short/far) transp..

  Appeal to force-circumstantial-division and composition

That biscotti ought to be good? I used only the best ingredients in it?  appeal to force.  circumstantial.  division  composition

  As you have learned population dynamics are caused by the

why do you see increases and decreases in the invasive species population?what are the implications associated with

  Discuss its applicability to the caribbean

In a 1500 word essay, Give your opinion or argument on Oswald Spengler's theory of civilization and discuss its applicability to the Caribbean.

  Explain the injustice and protest and describe how

martin luther king jr. was many things a civil rights activist nonviolent protestor organizer teacher son husband

  User to enter two integer numbers

Write a program which asks the user to enter two integer numbers. If the first number is greater than the second number (but not equal), the program should print on the screen “The first number is greater than the second”, otherwise it prints “The fi..

  What are the posterior probabilities of good day

A company manufactures thousands of wigets each day. On a good day,only 0.6% of the production is defective. However, bad days occur 15% ofthe time, and 11% of the production is defective on these days.

  What is the first exterior finish that should be eliminated

What is the first exterior finish that should be eliminated? Assuming that floor joists are set on standard 16" centers, how many joists are needed for a floor that is 49 feet long? When doing a wall system takeoff, two extra studs are allowed at ___..

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