Thursday, April 30, 2015

Java Objective Type Questions & Answers

1.The exception class is in ___________ package

1.java.file

2.java.io

3.java.lang

4.java.util

2.Which keyword is used to monitor statment for exception

1.try

2.catch

3.throw

4.throws

3.If and exception is generated in try block, then it is caught in _____ block

1.finally

2.throw

3.throws

4.catch

4.To explicitly throw an exception, ____ keyword is used

1.try

2.catch

3.throw

4.throwing

5. If a statement tries to divide by zero which exceptio is thrown

1.ArithemticException

2.NullPointerException

3.NumberFormatException

4.None of these

6. when a method can throw an exception then it is specified by_______ keyword

1.finally

2.throw

3.throws

4.catch

7. Which block gets executed compulsory whether exception is caught or not

1.finally

2.throw

3.throws

4.catch

7. To create our own exception class, we have to __________

1.Extend exception class

2.Create our own try and catch block

3.use finally block

4.use throws keyword

8.Java was first developed in

1.1990

2.1991

3.1993

4.1996

9.Which of the following feature is not supported by java

1.Multithreading

2.Reflection

3.operator overloading

4.Garbage collection

10.which of the following is not keyword in java

1.null

2.import

3.volatile

4.package

11.What is the full form of JVM

1.Java Virtual Machine

2.Java Variable Machine

3.Java Virtual Mechanism

4.Java Variable

12.Which among the followin is the compulsory section of java program

1.package statment

2.import statement

3.Documentation section

4.Class declaration section

13.The extension name of a java source code file is

1. .java

2. .obj

3. .class

4. .exe

14.Java is also known as ........stage language

1. One

2. Two

3. Three

4. Four

15.what is HotJava

1. System software

2. web browser

3. java environment

4. IDE

15.what is HotJava

1. System software

2. web browser

3. java environment

4. IDE

16.who invented JAVA

1. James Gosling

2. Dennis Ritchie

3. G.N.Sujeer

4. None of the above

17.Which is a reserved word in the java programming language

1. method

2. native

3. subclasse

4. array

18.Which method executed only once

1. start()

2. init()

3. destroy()

4. none of the above

19.who invented java

1. Netscape

2. Microsoft

3. Sun

4. none of the above

20.Which of these stream contains the classes which can work on charactr stream

1. InputStream

2. OutputStream

3. CharacterStream

4. All of the mentioned

20.Which of these class is used to read characters in a file

1. FileReader

2. FileWriter

3. FileInputStream

4. FileStreamReader

21.Which of these is a method to clear all the data present in output buffers

1. clear()

2. flush()

3. fflush()

4. close()

22.Which of these packages contain classes and interfaces used for input and output operators of a program

1. java.util

2. java.lang

3. java.io

4. All of the mentioned

22.Which of the following is the smallest integer data type

1. int

2. long

3. byte

4. short

23.Which of the following is not a primittive data type

1. byte

2. short

3. enum

4. int

24.What is the range of data type short in java

1. -128 to 127

2. -32768 to 32767

3. -2147483648 to 2147483647

4. none of the mentioned

25.What is the range of data type int in java

1. -128 to 127

2. -32768 to 32767

3. -2147483648 to 2147483647

4. none of the mentioned

26.Default value of Boolean data type in java

1. true

2. false

3. 1

4. 0

26.Which of the following is the reference data type

1. int

2. short

3. double

4. array

27.Which keyword is used while using interface

1. extend

2. implements

3. throw

4. thows

28.If method have same name as class name and method don't have any return type then it is known as

1. object

2. variable

3. Constructor

4. none of the above

28.Thread class is available in

1. java.io package

2. java.lang package

3. java.awt package

4. java.util package

29.The Applet class is in...............package

1. java.applet

2. java.awt

3. java.io

4. java.util

30.which of the following is an optional attribute of applet tag

1. code

2. name

3. width

4. height


No comments:

Post a Comment