PRACTICE JAVA
Which one of the following is not true?
a. A class containing abstract methods is called an abstract class. b. Abstract methods should be implemented in the derived class. c. An abstract class cannot have non-abstract methods. d. A class must be qualified as
Which statement is true for the class First given below?
package myPackage: class First { /* class body */ } a. first class is accessible to all classes defined inside or outside my package. b. first class is accessible to classes within my package. c. first
Object-oriented inheritance models the
a. “is a kind of” relationship b. “has a” relationship c. “want to be” relationship d. “contains” of relationship Answer: a. “is a kind of” relationship Explanation: Inheritance in java is a type of “IS-A”
What is garbage collection in the context of java?
a. The operating system periodically deletes all of the java files available on the system b. When all the references to an object are gone, the memory used by the object is automatically reclaim. c.
Which of the following are valid array declarations?
a. int number(); b. float average[]; c. counter int[]; d. []double marks; Answer: b. float average[]; Explanation: The correct syntax for declaring an array is dataType arrName[size]; Although the size of the array is not
Which of the following is true for JNDI?
a. Database Service b. Naming and directory service c. Network service d. The Web service Answer: b. Naming and directory service Explanation: The Java Naming and Directory interface is an API that provides naming and directory
Aniket Malik
CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS
My students are the presents from God to me
Do you want to learn
Programming?
Hey, I’m Aniket. I’m determined to make you one of the best developers in the history of Information technology.
My only question is, are you ready?