just answers Name: D: A 44, The classes Reader and Write r are derived from the
ID: 3707747 • Letter: J
Question
just answers
Name: D: A 44, The classes Reader and Write r are derived from the class a Streans b. Input:s c outputs d. object the class Mystery is derived from the class secret. Consider the following statements Secret secRef new Secret) Mystery mysRef new Mystery Which of the following statements is legal in Java? (0) secRet mysRef; (ii) mysRef secRef a. Only (i) b. Only (ii) e. d. Both (i) and (ii) None of these 46. Suppose that the class Mystery is derived from the class Secret. Consider the following Secret mySecret new Secret( Secret secRet Mystery myMysterynew Mystery Nystery mysRef secRefmyMystery Which of the following statements is legal in Java? (i) mysRet(Mysteryl mySecreti (ii) mysRef Myatery) secRef: a. Only (0) b. Only (i) c. Both () and (ii) d. None of these Which operator is used to determine if an object is of a particular class type? a. b. 47. The operator new The dot (.) operator c. The instanceof operator d. The operator 48. An abstract class can contain abstract and non-abstract methods nothing only abstract methods c. d. a. b. oaly non-abstract methods 49. An abstract class a does not have any subclasses b. is a superclass with many subclasses . is the base class of all other classes c. cannot be instantiated 12Explanation / Answer
SOLUTION:
Q 44) a) Streams
The reader and writer casses are derived from the stream class in java. The reading and writing from console is performed with the help of stream .
Q 45) a) Only (i)
As cass Mystery is derived from class Secret .Therefore class secret is the parent class of Mystery thus it can contain its child's object .
Q 46) b) Only (ii)
As Mystery is the child class of Secret , The statement in (i) is wrong as Secret class's reference variable can not be cast into Mystery class, whle Mystery class's reference variable can be cast into Secret class as Mystery class is derived from Secret class
Q 47) c) The instanceof operator
This instanceof operator tells the type of the object
Q 48) c) abstract and non-abstract methods
This is a common misconception that abstract class contain only abstract methods but this is wrong abstract class can containg abstract as well as non- abstract methods also
Q 49) c) cannot be instantiated
As abstract class contain abstract methods this means the definition of the method is not there. So creating instance of a class whose behaviour is not defined or unknown is not logically correct that;s why abstract class can not be instantiated
PLEASE Rate ! !
Thanks!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.