Question: 2 . You send messages or information to an object through its _ _ _ _ _ _ _ _ _ . A . fields

2. You send messages or information to an object through its _________.
A. fields
B. methods
C. classes
D. type
4. The body of a class is always written _________.
A. in a single line, as the first statement in a class
B. within parentheses
C. between curly braces
D. as a method call
6. The concept of allowing a classs private data to be changed only by a classs own methods is known as _________.
A. structured logic
B. object orientation
C. information hiding
D. data masking
8. If a class is named Student, the class constructor name is _________.
A. any legal Java identifier
B. any legal Java identifier that begins with S
C. StudentConstructor()
D. Student()
10. If you declare a variable as an instance variable within a class, and you declare and use the same variable name within a method of the class, then within the method, _________.
A. the variable used inside the method takes precedence
B. the class instance variable takes precedence
C. the two variables refer to a single memory address
D. an error will occur
12. A constructor _________ overloaded.
A. must be
B. cannot be
C. can be
D. is always automatically
14. If you create a class that contains one method, and you instantiate two objects, you usually store _________ for use with the objects.
A. one copy of the method
B. two copies of the method
C. two different methods containing two different this references
D. data only (the methods are not stored)
16. Methods that you reference with individual objects are _________.
A. private
B. public
C. static
D. nonstatic
18. The keyword final used with a variable declaration indicates _________.
A. the end of the program
B. it is in a static method
C. a symbolic constant
D. that no more variables will be declared in the program
20. Which of the following expressions correctly returns an integer that represents the month of a LocalDate object named hireDate?
A. getMonth(hireDate)
B. getMonthValue(hireDate)
C. hireDate.getMonthValue()
D. hireDate.setMonthValue()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!