Professional Documents
Culture Documents
Model Question Paper Subject Code: BC0047 Subject Name: Java Programming Credits: 4 Marks: 140 Part A (One Mark Questions)
Model Question Paper Subject Code: BC0047 Subject Name: Java Programming Credits: 4 Marks: 140 Part A (One Mark Questions)
Marks: 140
Part A (One mark questions)
1. ___________ is the ability of an Java application to perform multiple tasks at the same time.
A) Multiprogramming
B) Multithreading
C) Multiprocessing
D) Multitasking
2. Java is designed for the distributed environment of the Internet, because it handles
_________ protocols
A) UDP
B) TCP/IP
C) FTP
D) TEL
3. Java is associated with _______ programming Language
A) Oak
B) Basic
C) C
D) Perl
8. Java platform consists of JVM and a package of readymade software components this
package is known as ___________.
A) Java API
B) JVM API
C) JM API
D) API
9. Which of the following is not a Looping statement ____________
A)FOR
B)Switch
C)while
D)Do-While
10. _____________ is a multi way branch statement
A) Switch
B) continue
C) break
D) Label
11. Choose the proper operator precedence when evaluating an Expression?
1. Comparisons
2. Logical operations
3. Increment
4. Arithmetic operations
A) 1-2-4-3
B) 4-3-1-2
C) 2-1-4-3
D) 3-4-1-2
12. The ______ statement is used inside the switch to terminate a Statement sequence
A) break
B) Jump
C) exit
D) goto
13. A class that is inherited is called a superclass ____________
A) superclass
B) Subclass
C) subsetclass
D) Relativeclass
14. An _________ determines which features of a class may be used by other classes
A) specifier
B) inheritance
C) implementation
D) Access specifier
15. Which property of Java allows the creation of hierarchical classifications?
A) Interface
B) Inheritance
C) Robust
D) Distributed
16. Which of the following is WRONG statement with respect to rules for overriding Methods?
A) The method name and the order of arguments should be identical to that of the super
class method.
B) The return type of both the methods must be the different.
C) The overriding method cannot be less accessible than the method it overrides.
D) An overriding method cannot raise more exceptions than those raised by the super
class.
17. The class at the top of the exception classes hierarchy is called ____________
A) Common
B) Throwable.
C) NULL
D) Catch
18. Find the keyword which is not used to implement exception
A) try
B) catch
C) finally
D) access
19. Which of the following is not a Exceptions in Java.
A) Arithmetic Exception
B) Nullpointer Exception
C) ArrayoutofBounds Exception
D) Logical Exception
23. Which of the following statement is the explanation of the int read () method
A) Reads a byte of data from the input stream
B) Reads bytes of data from the input stream and stores them in the array
C) Reads the number of bytes specified by the third argument from the input stream and
stores.
D) Returns the number of bytes available for reading from the input stream
24. Which method is used to read a byte as an 8-bit signed value?
A) Boolean readbyte()
B) byte read()
C) readbyte()
D) byte readByte()
25.
A) Applets
B) browser
C) package
D) None of these
26. A applet tag is written in body tag of ___________
A) HTMM
B) HTTP
C) HTML
D) Applet
27. All applets must be declared as ________.
A) Protected
B) Public
C) Private
D) Static
28.________ method is called the first time an applet is loaded into the memory
of a computer
A) init method()
B) start method()
C) stop method()
D) destroy method()
29.___________ is a set of computer programs that controls the creation, maintenance, and the
use of the database of an organization and its end users
A) DBMS
B) MS
C) BMS
D) BDMS
30. _______ provides a database-programming interface for Java programs
A) ODBC
B) JDBC
C) DBMS
D) DAT
49.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
50. 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
51. The two major classes for byte streams are _______ and _______
A) Input,Output.
B) byteStream,bitStream.
C) InputStream,OutputStream.
D) stringStream,stingStream.
52. 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.
53. 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()
54. Which of the following method does not belong to graphics class?
A. Text
B. pixel
C. Lines
D. Circle and ellipse.
55. 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 () ,
56.
A. 1-T,2-T
B. 1-T,2-F
C. 1-F,2-F
D. 1-F,2-T
57. 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
58.
A. 1-T,2-T
B. 1-T,2-F
C. 1-F,2-F
D. 1-F,2-T
59. 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
60. 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
c. Servlets
d. Packages
A) ABCDEF
ABCDEF
B) ABCDEF
ABC
C)
ABC
DEF
D)
ABCDEF
CDE
A) 5, 7, 16, 18
B) 8, 9, 19, 20
C) 12,13,16,20
D) 5, 8, 13, 19
66. Find the relationship?
A) Syntax error
B) Since i is public
C) Since Class B cannot extends A
D) Since j is declared as private
68. State true or false?
a. Running out of memory is an unexpected situation during program execution
b. The try statement can be nested
c. A try block must have at least one catch block that follow it immediately
d. Three classes are derived from Throwable class
A) a-T,b-T,c-F,d-F
B) a-T,b-T,c-F,d-T
C) a-F,b-T,c-T,d-F
D) a-T,b-T,c-T,d-F
Explanation
ii
iii
void flush ()
iv
1. The DataInputStream and DataOutputStream classes are filter streams that allow the reading
and writing of user defined data types
2. The DataInputStream class provides the capability to read primitive data types from an input
stream
3. The BufferedInputStream class creates and maintains a buffer for an input stream.
4. BufferedOutputStream represents filter streams.
A)1-T,2-F,3-F,4-F
B) 1-T,2-T,3-F,4-F
C) 1-T,2-T,3-T,4-F
D) 1-F,2-T,3-T,4-T
71. State True or false
1. Event handling is essential to GUI programming
2. Java programs written to run on world wide web are called as applets
3. Applets cannot run on any browser that supports java
4. Typically GUI programs wait for the user to perform some action
A) 1-T,2-T,3-F,4-F
B) 1-T,2-F,3-F,4-F
C) 1-T,2-T,3-F,4-T
D) 1-T,2-T,3-F,4-T
ActionEvent object
ii.
AdjustEvent object
iii.
ContainerEvent object
iv.
FocusEvent object
A) 1=servlets service () method processes the request and returns output to client
2=server unloads the servlet after calling its destroy() method
3=sever calls the init () method of each servlet instance
Answer Keys
Part - A
Q. No.
Ans. Key
Part - B
Q. No.
Ans. Key
Q. No.
Part - C
Ans. Key
Q. No.
Ans. Key
21
41
61
22
42
62
23
43
63
24
44
64
25
45
65
26
46
66
27
47
67
28
48
68
29
49
69
10
30
50
70
11
31
51
71
12
32
52
72
13
33
53
73
14
34
54
74
15
35
55
75
16
36
56
17
37
57
18
38
58
19
39
59
20
40
60