Ov Sample QB Oop in Java
Ov Sample QB Oop in Java
QUESTION BANK
MODULE NAME: Object-oriented Programming in Java
Category - Simple
a) try
b) catch
c) finally
d) exception
2)
__________ is the inverse of throughput. That is, the percentage of total time spent in
garbage collection.
a) Pause time
b) Frequency of collection
c) Promptness
3) ___________ interface is extended by the sub interfaces Set, List, and Queue.
a) Vector
b) Collection
c) HashMap
d) Tree
a) repeat()
b) read()
c) close()
d) available()
5) __________ driver translates JDBC calls into database-specific calls or native calls.
a) ODBC-JDBC Bridge
Category - Average
c) Writing assertions while programming is one of the most difficult ways to detect and
correct errors in the code.
What will be the index of the string ‘bat’ when the expression ^bat$ is applied to it?
a)
Starting at index 1 and ending at index 3
b)
Starting at index 0 and ending at index 2
c)
Starting at index 0 and ending at index 3
d)
Starting at index 1 and ending at index 2
a) HashSet<String>();
b) The code reviews are difficult in Generics as the ambiguity is more between containers.
d) A local variable cannot be declared where the key and value types are different from each
other.
Category – Difficult
Identify the correct code to create a locale for the country Canada for the French language.
b) Design patterns are based on the fundamental principles of object oriented design.
a) jdbcRs.relative(2);
jdbcRs.updateFloat(“RATE”, 14.00f);
jdbcRs.updateRow();
b) jdbcRs.updateFloat(“RATE”, 14.00f);
jdbcRs.absolute(2);
jdbcRs.updateRow();
c) jdbcRs.absolute(3);
jdbcRs.updateFloat(“RATE”, 14.00f);
jdbcRs.update();
d) jdbcRs.absolute(3);
jdbcRs.updateFloat(“RATE”, 14.00f);
jdbcRs.updateRow();
c) Two or more threads try to read and write the shared data simultaneously.
a) . . .
String temp = “Welcome to the world of Java”;
byte [] bufObj = temp.getBytes();
ByteArrayInputStream fileObj = new
ByteArraInputStream(bufObj);
BufferedInputStream inObj = new BufferredInputStream(fileObj);
. . .
b) . . .
String temp = “Welcome to the world of Java”;
ByteArrayInputStream fileObj = new ByteArraInputStream();
byte [] bufObj = temp.getBytes();
BufferedInputStream inObj = new BufferredInputStream(bufObj);
. . .
c) . . .
String temp = “Welcome to the world of Java”;
byte [] bufObj = temp.getBytes();
BufferedInputStream inObj = new BufferredInputStream(bufObj);
ByteArrayInputStream fileObj = new
ByteArraInputStream(fileObj);
. . .
d) . . .
String temp = “Welcome to the world of Java”;
byte [] bufObj = getBytes(temp);
ByteArrayInputStream fileObj = new
ByteArraInputStream(bufObj);
BufferedInputStream inObj = new BufferredInputStream(fileObj);
. . .