PRACTICE JAVA
Which of the following live on the heap in Java?
a) Class b) Instance c) Method d) Object Answer d) Object Explanation: Heap space is utilized for the dynamic memory allocation of Java objects and JRE classes at runtime. New objects are always created in
Which of these is returned by greater than, less than, and equal to operators?
a) Integers b) Floating–point numbers c) Boolean d) None of the mentioned Answer c) Boolean Explanation: Relational operators compare numeric, character string, or logical data. The result of the comparison is either true or false.
An expression involving byte, int, and literal numbers is promoted to which of these?
a) int b) long c) byte d) float Answer a) int Explanation: In an expression involving bytes, ints, shorts, or literal numbers, the entire expression is promoted to int before any calculation is done so
Which of the below is not a Java Profiler?
a) JProfiler b) Eclipse Profiler c) JVM d) JConsole Answer c) JVM Explanation: JVM is not a profiler. JVM is responsible for executing the java program line by line hence it is also known as
Which of these operators is used to allocate memory to array variable in Java?
a) malloc b) alloc c) new d) new malloc Answer c) new Explanation: The new operator is used to allocate a block of memory specified by the size of an array to the array variable.
Which of these keywords is used to refer to member of base class from a subclass?
a) upper b) super c) this d) none of the mentioned Answer b) super Explanation: Whenever a subclass needs to refer to its immediate superclass, it can do so by use of the keyword super.
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?