Java Interview Questions
Q91. SecurityException is for
(a) Caused when there's not enough memory to allocate a new object
(b) Caused when an applet tries to perform an action not allowed by the browser's security setting
(c) Caused when the system runs out of stack space
(d) Caused by referencing a null object
Answer: (b) Caused when an applet tries to perform an action not allowed by the browser's security setting
Q92. Which of the following is true “An applet can play an audio file represented by the AudioClip interface in the java, applet package Causes the audio clip to replay continually for______”
(a) public void stop()
(b) public void play()
(c) public void loop()
(d) Both A and B
Answer: (c) public void loop()
Q93. ________ method is called only once during the run time of your applet
(a) init()
(b) start()
(c) stop()
(d) destroy()
Answer: (a) init()
Q94. How many reserved keywords are currently defined in the Java language
(a) 32
(b) 39
(c) 45
(d) 50
Answer: (d) 50
Q95. Output of relational operators is
(a) Short
(b) Integer
(c) Boolean
(d) All of above
Answer: (c) Boolean
Q96. Which operator is used to allocate memory to array variable in Java
(a) calloc
(b) new
(c) malloc
(d) None of above
Answer: (b) new
Q97. Which one is not a keyword in Java
(a) Private
(b) Throw
(c) Void
(d) Run
Answer: (d) Run
Q98. Which of the following operator in Java have context dependent meaning
(a) +
(b) ++
(c) &
(d) All of the above
Answer: (d) All of the above
Q99. Which of the following does not have a superclass in Java
(a) System
(b) Object
(c) Lang
(d) Exception
Answer: (c) Lang
Q100. Which of the following statements will result in compilation error in Java
(a) signed int abc;
(b) unsigned int abc;
(c) signed byte abc;
(d) All of the above
Answer: (d) All of the above
Q101. In Java Garbage collector frees the programmer from worrying about
(a) Memory issues
(b) dangling references
(c) creating new objects
(d) recursion
Answer: (b) dangling references
Q102. In Java, Is null an object
(a) Yes
(b) No
(c) Sometimes Yes
(d) None of the above
Answer: (b) No
Q103. Which of the following component is not used to act as a input/output stream in Java
(a) file
(b) class
(c) a pipe
(d) array of bytes
Answer: (b) class
Q104. What is the immediate super class of Applet Class
(a) Object
(b) Window
(c) Panel
(d) Component
Answer: (c) Panel
Q105. In Javascript each window object has sub-object, which called
(a) Features
(b) Properties
(c) Characteristics
(d) Qualifiers
Answer: (b) Properties
Practice Test Exam