Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

dit View History Bookmarks People Window Help E 9 Exam ure https:llsisu.instruct

ID: 3841887 • Letter: D

Question

dit View History Bookmarks People Window Help E 9 Exam ure https:llsisu.instructure.com/courses/1233754/quizzes/1197998/take Mail M Gmail Google Docs En LinkedIn eBay Canvas Soundcloud OYouTube n ia sc converter an SPORTS o 1.2.3.6 D Question 45 1 pts ACass object oontains the runtime type information for uava objects and primitive types one can use ether getCass0 or class to retrieve the Class object for an int primitive type. D Question 46 1 pts Even thougha lava string is immutable, we can subclass from the String class and add additional methods toovemide the behavior of Java string Question 47 class Car

Explanation / Answer

Question 45: True

Object.getClass()

The way of getting its Class is to invoke Object.getClass(), if the object instance is available. This works for the reference types which inherits from Object.

Class c = “abc”.getClass();

return string

.class

The way to obtain the class for a primitive types is by appending “.class” to the name of its types.

Boolean bo;

Class c = Boolean.class;

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Question 46: False

Guidelines to Class immutable