• CALL US: +91-8561868421
  • Address: Plont No 67 OM Shiv Colony Jhotwara Jaipur-12

Java Language Quiz

(Total Question : 30)

Q.1

Which one of these lists contains only Java programming language keywords?

Q.2

Which will legally declare, construct, and initialize an array?

Q.3

Which is a reserved word in the Java programming language?

Q.4

Which is a valid keyword in java?

Q.5

Which one of the following will declare an array and initialize it with five numbers?

Q.6

You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?

Q.7

public class Test { }
What is the prototype of the default constructor?

Q.8

What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package?

Q.9

Which cause a compiler error?

Q.10

You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?

Q.11

Which of these class is superclass of all other classes?

Q.12

Which of these method of Object class can generate duplicate copy of the object on which it is called?

Q.13

What is the value of double consonant ?E? defined in Math class?

Q.14

Which of these method is a rounding function of Math class?

Q.15

Which of these class contains only floating point functions?

Q.16

Which is true about an anonymous inner class?

Q.17

Which is true about a method-local inner class?

Q.18

Which statement is true about a static nested class?

Q.19

Which constructs an anonymous inner class instance?

Q.20

What is the name of the method used to start a thread execution?

Q.21

Which cannot directly cause a thread to stop executing?

Q.22

Which of the following will directly stop the execution of a Thread?

Q.23

Which method must be defined by a class implementing the java.lang.Runnable interface?

Q.24

Which will contain the body of the thread?

Q.25

public class MyOuter 
{
    public static class MyInner 
    {
        public static void foo() { }
    }
}
which statement, if placed in a class other than MyOuter or MyInner, instantiates an instance of the nested class?

Q.26

What allows the programmer to destroy an object x?

Q.27

Which of the following is a garbage collection technique?

Q.28

What is -Xms and -Xmx while starting jvm?

Q.29

Which exception is thrown when java is out of memory?

Q.30

How to get prints of shared object memory maps or heap memory maps for a given process?