0% found this document useful (0 votes)
65 views9 pages

Answer

The document contains 30 multiple choice questions about Java programming concepts. The questions cover topics such as object oriented programming concepts like polymorphism and inheritance, Java data types, exception handling, input/output streams, databases, remote method invocation, web applications, and the servlet life cycle.

Uploaded by

Dr. Karthickeyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views9 pages

Answer

The document contains 30 multiple choice questions about Java programming concepts. The questions cover topics such as object oriented programming concepts like polymorphism and inheritance, Java data types, exception handling, input/output streams, databases, remote method invocation, web applications, and the servlet life cycle.

Uploaded by

Dr. Karthickeyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

1.

Virtual function allow us to

a) Create function that has no body

b) Use same function call to execute member functions of objects from different classes

a) a is true b is false

b) a is false b is true

c) Both are true

d) Both are false

2. Polymorphism in java is implemented through -----------

a) Virtual function

b) Function overloading

c) Both above

d) None of these

3. Which of the following statement is correct?

a) The Buffered Input Stream class creates and maintains a buffer for an input stream.

b) String object we are creating can be changed

i) Both a and b true

ii) a false and b true

iii)a true b false

iv) None

4.example of numeric constant

a) 23000

b) 450.6

i) a is true ii)b is true

iii)both true iv)none


5. Example of character constant

a)’SUM’

b) ‘9’

i) a is true b is false

ii) a is false b is true

iii) Both a and b is true

iv) Both are false

6. Relational operator are

a)&&

b)++

i) a is true b is false

ii)a is false b is true

iii)Both a and b is true

iv)Both are false

7. a) the class at the top of the exception classes hierarchy is called Error.

b) This is the keyword referring super class hidden members

i) a is true b is false ii) a is false b is true iii) Both a and b is true iv) Both are false

8.a) The exception class is used for the exceptional conditions that have to be trapped in a program

b) A class can be declared as final if we do not want the class to besubclassed

i) a is true b is false

ii) a is false b is true

iii) Both a and b is true

iv) Both are false


9. Each case in switch statement should end with--------- statement

a)default

b)break

c)continue

d)none

10. Which of the following statement is correct?

a)CLASSPATH is environmental variable

b) The class at the top of the exception classes hierarchy is called Error

i) a is true b is false

ii) a is false b is true

iii)Both a and b is true

iv)Both are false

11. ----------- is a highly optimized set of instructions designed to be executed by the Java runtime

system, which is called the -------------.

A) Bytecode, Java Virtual Machine

B) Data Code, Java machine

C) Source code, Microsystems

D) Bytecode ,Microsystems.

12.Two kinds of data types in java are _________and __________ Primitive and non primitive are 2
data types in java

A) Primitive,standard

B) Primitive,Abstaract

C) abstract,derived

D) constants, variables
13. Which of the following is not a java data type?

1. byte

2. register

3. long

4. nibble

5. int

6. char

A) 4 and 5 only

B) 1and 3 only

C) 5 and 6 only

D) 2 and 4 only

14. The output of the following Program is (Sorry but no program is showing in th qn set!)

A) The sum of Two number is: 30

B) The sum of Two number is: 20

C) The sum of Two number is: 10

D) The sum of Two number is: 40

15. What is byte code in the context of Java?

A. The type of code generated by a Java compiler

B. The type of code generated by a Java Virtual Machine


C. It is another name for a Java source file

D. It is the code written within the instance methods of a class.

E. It is another name for comments written within a program.

16.The ______ keyword is used to derive a class from a superclass. The ________keyword is used to
declare classes that define common properties and behavior of other

classes

A) Public ,friend

B) abstract ,extends ,

C) extends , abstract

D) friend ,Public

17. A class can be declared as _______ if you do not want the class to be subclassed. Using

the __________keyword we can abstract a class interface from its implementation

A) protected ,interface

B) final,interface

C) public,friend

D) final,protected

18.The term exception denotes an ________ event .Java handles exceptions the

______________ way.

A) exceptional ,object-oriented

B) traditional, object-oriented

C) exceptional, procedural

D) friend ,Public
19. Identify the situations in which an null exception is NOT thrown

1. Using an object without allocating memory for it.

2. Calling the methods of a null object.

3. Accessing or modifying the attributes of a null object.

4. Attempt to access an array element beyond the index of the array

A) 1

B) 3

C) 4

D) 2

20. The two major classes for byte streams are ______ and ______

A) Input,Output.

B) byteStream,bitStream.

C) InputStream,OutputStream.

D) stringStream,stingStream.

21. The _______ and ________ classes are filter streams that allow the reading and

Writing of Java primitive data types.

A) InputStream, OutputStream

B) DataInputStream, DataOutputStream

C) Input,Output.

D) byteStream,bitStream.

22. The ______ method takes a Graphics class object as a parameter. The _______ method

draws the graphics of the applet in the drawing area.

A) paint (),update ()
B) repaint(),Paint()

C) update () , paint ()

D) Paint(),repaint()

23. Which of the following method does not belong to graphics class?

A. Text

B. pixel

C. Lines

D. Circle and ellipse.

24. To establish a connection with a database, you need to register the ODBC-JDBC Driver by

calling the _________ method from the Class class and then calling the _______ method

from the DriverManager class.

A) getConnection (),forName ()

B) for () , get ()

C) get (), for () ,

D) forName (), getConnection ()

25. State True or False

1. The sql.java package contains classes that help in connecting to a database, send SQL

statements to the database

2. The Stringset () method sets the query parameters of the Prepared Statement Object.

A. 1-T,2-T

B. 1-T,2-F

C. 1-F,2-F

D. 1-F,2-T
26. The __________ is used to handle the errors that may occur during the invocation of a

Remote method. Remote Method Invocation uses _________Protocol

A) Interface,TCP

B) Exception,TCP

C) Exception,UDP

D) Interface,UDP

27. State True or False

1. Java IDL is based on the COBOL

2. The stub and the skeleton communicate through Application layer.

A. 1-T,2-T

B. 1-T,2-F

C. 1-F,2-F

D. 1-F,2-T

28. Arrange the following steps to complete a request and response in a typical web application

1. Send a request to the web server.

2. Web application will collect data from the user. (First tier)

3. Send it back to the browser for display. (First tier)

4. Run the requested server program. (Second and third tier)

5. Package up the data to be presented in the web browser.

A) 1-2-5-3-4

B) 2-1-4-5-3

C) 2-1-3-4-5

D) 1-2-4-5-3

29. State True or False


3. Maintenance is the greatest problem in 2-tier Architecture of web architecture.

4. The basic idea behind 3-tier architecture is that to separate application logic from the

user interface

A. 1-T,2-T

B. 1-T,2-F

C. 1-F,2-F

D. 1-F,2-T

30. In the init(ServletConfig) method of Servlet life cycle, what method can be used to access the
ServletConfig object ?

(a) getServletInfo()

(b) getInitParameters()

(c) getServletConfig()

(d) none of these

You might also like