Java Programming Questions and Answers Set 26

Java Programming OOPs

Questions 251 to 260


251.
Which of the following is not a built-in exception found in java API?
(a)
IOException
(b)
NullPointerException
(c)
ArithmaticException
(d)
FileNotFoundException
(e)
SystemFoundException.
252.
Which of the following exception is caused when a math error such as division by zero occurs?
(a)
ArithmaticException
(b)
DivisionByZeroException
(c)
NumberFormatException
(d)
IOException
(e)
ArrayIndex OutofBoundException.
253.
Which of the following is not an Applet method?
(a)
start()
(b)
init()
(c)
run()
(d)
stop()
(e)
destroy().
254.
Which of the following is not a valid Java identifier?
(a)
my Value
(b)
$_AAA1
(c)
width
(d)
m_x
(e)
my_value.
255.
Which of the following method is inherited by Applet from its parent class?
(a)
paint
(b)
start
(c)
init
(d)
stop
(e)
run.
256.
Which of the following is a character stream?
(a)
FileInputStream
(b)
DataInputStream
(c)
BufferedInputStream
(d)
FileReader
(e)
FileOutputStream.
257.
Which of the following stream is/are used to handle primitive data types?
(a)
BufferedOutputStream
(b)
DataInputStream
(c)
FileOutputStream
(d)
FileInputStream
(e)
All the above.
258.
Which of the following stream is used for Object Serialization?
(a)
DataOutputStream
(b)
DataInputStream
(c)
ObjectOutputStream
(d)
ObjectWriter
(e)
ObjectReader.
259.
Every Java applet or application is composed of at least one
(a)
Method
(b)
Data member
(c)
Class definition
(d)
Imported class
(e)
Package definition.
260.
The extends keyword creates a new
(a)
Instance
(b)
Subclass
(c)
Baseclass
(d)
Superclass
(e)
Object.



Answers


251.
Answer : (e)
Reason  :       SystemFoundException is not a built-in exception.
252.
Answer : (a)
Reason  :       Arithmetic Exception is caused when a math error such as division by zero occurs
253.
Answer : (c)
Reason  :       run() is not an applet method
254.
Answer : (a)
Reason  :       my Value (Identifiers may not contain blanks)
255.
Answer : (a)
Reason  :       paint following method is inherited by Applet from its parent class.
256.
Answer : (d)
Reason  :       FileReader is a character stream.
257.
Answer : (b)
Reason  :       DataInputStream is used to handle primitive data types
258.
Answer : (c)
Reason  :       ObjectOutputStream  is used for Object Serialization
259.
Answer : (c)
Reason  :       Class definition
260.
Answer : (b)
Reason  :       subclass (the class is derived from the superclass)



<< Prev   1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17   18   19   20   21   22  

 23   24   25   26   27   28   29   30  Next >>




No comments :

What you think about these Questions and Answers ? Let me know in comments.

Post a Comment