Question: 2 . You send messages or information to an object through its _ _ _ _ _ _ _ _ _ . A . fields
You send messages or information to an object through its
A fields
B methods
C classes
D type
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
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
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
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
A constructor overloaded.
A must be
B cannot be
C can be
D is always automatically
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
Methods that you reference with individual objects are
A private
B public
C static
D nonstatic
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
Which of the following expressions correctly returns an integer that represents the month of a LocalDate object named hireDate?
A getMonthhireDate
B getMonthValuehireDate
C hireDate.getMonthValue
D hireDate.setMonthValue
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
