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

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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