csa unit 2 test

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

what is the value of z after this code segment is executed?

1.0

what is the final value of temperature

68

which code segment can be used to create a dog that is 3 years old with no puppies

I and III

Consider the following constructor, which is intended to assign the parameter x to an instance variable also named x. Which changes can be made for the code to work as intended?

I change line 2 to this.x = x; and III change the parameter name to newx and update line 2 to x = newX;

which of the following would correctly prints the output:

System.out.println("You say \" goodbye \" , \n I say \" hello \" .");

which of the following changes to grocery item will allow other classes to access but not modify the value of price

include the method public double getPrice() { return price; }

which one of the following is not correct?

int price = 40.99;

which got the following is the replacement for the missing code in the Store class?

private String name; private String website; private Store(String nm, String web) {/* implementation not shown */ }

which of the following is the best header for the method of the Mystery class that would change the value of the private instance variable x given an int so that it can be called from a class other than mystery?

public void setX(int X)

which best describes the visibility of the instance variables of this class?

sum is visible only within the class, inputs is visible outside of the class.

which of the following best describes the effect of executing the statement?

the Plant variable maple is instantiated as a tree. the call super(treeColor) invokes the plant constructor and initializes the instance variable leafColor with the value from the parameter treeColor. the instance variable treeDiameter is then initialized with the value from the parameter diameter.

the accessor method getOwner is intended to return the name of the owner of the FoodTruck object. Which of the following best explains why the class does not compile?

the return type of the getOwner method needs to be defined as a string.

which of the following best explains the reason why the code segment will not compile?

the setGpa method does not return a value that can be printed.

which of the following best explains why the class did not compile?

the setOwner method should not return.

which is an overloading constructor

when more than one constructor is defined in a class


संबंधित स्टडी सेट्स

Chemistry 115 Exam One Study Guide

View Set

GCSE Psychology: Research Methods

View Set

The Conquest of the Far West- Chapter 16

View Set

Investigating God's World 5th Grade Chapter 2

View Set

Texas Life and Health Exam - Master Study Guide

View Set

Chapter 16 Lewis : Fluid & Electrolytes

View Set

CH 20 upper respiratory disorders

View Set