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

  Nonworking poor should not be treated better than lowest

Public Assistance is rooted in the 16th Century British system of "the nonworking poor should not be treated better than the lowest- wage earners."

  Struggling local local suburban regional shopping mall

Imagine yourself as the manager of a struggling local local suburban regional shopping mall. what do you think the mall should do to improve its performance? what shopping trends do you foresee over the next 10 years?

  Shear size has both hindered and helped this country

The Russian Federation is extremely large in area. Discuss how the shear size has both hindered and helped this country. Also, discuss how the relative location of Russia has had advantages and disadvantages. Use examples to illustrate any points you..

  Important to an overall discussion of religion

"Develop 6 key ideas that are important to an overall discussion of religion. Explain why each of these is important, and explain the stance toward those topics within religion that we need to take in order to understand “religions responses.”

  Describe the term culturally responsible behaviour

What do you understand by cultural homogenization especially in the context of globalization Describe the term culturally responsible behaviour and explicitly discuss the attributes and ways to promote such behaviour in the tourism context

  Explain how you got your foot in the door

Four prospectors with only one lantern must walk through a mineshaft. At most, two prospectors can travel together and any prospector in the shaft must be with the lantern.

  Discuss and analyze regulations of civil rights act

Discuss and analyze the regulations of the Civil Rights Act of 1964 and the Civil Rights Act of 1991. Include a discussion of executive orders providing laws covering federal workers, including affirmative action requirements. Provide the URL address..

  In platos republic translated by robin waterfield socrates

In Plato's Republic translated by Robin Waterfield Socrates spends a lot of time on poetry and poets, who is he actually refering to? I feel like the "Poet" is a term used by Socrates that metaphorical/hypothetical for something, could you please ela..

  What are the components of physical examination

What are the components of physical examination? Describe each component and How does a medical provider take or measure blood pressure?

  Old testament and patriarchs

What impact does Aaron of the Old Testament have on Moses? On Israel? Include a description of his character in this discussion.

  Types of businesses have to make the choice

Companies and individuals running different types of businesses have to make the choices of the asset according to which of the following?

  Marketing strategies and mixes for international market

Explain how companies adapt their marketing strategies and mixes for international market.

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