Enter your search terms
Submit search form
Web
examineonline.googlepages.com
Online Exam
>>
Programming
>>
Java
>>
Advance Java 2
Menu
Programming
COMPTIA
GMAT
English
IQ
DataBase
OS
MCSE
CISCO
Finance
Management
Health
Soft Skills
Web Building
Multimedia
Advance Java 2
1 . __________________ is the mechanism that servlets use to maintain state series requests from the same user across some period of time.
A.
Monitor tracking
B.
Session tracking
C.
User tracking
2 . _____________ is the mechanism that servlets use to have a client hold a small amount of state information associated with the user.
A.
Application
B.
Session
C.
Cookies
3 . setMaxAge() is used to set the maximum age of the Cookie.
A.
True
B.
False
4 . Communication between servlets can be done by servlet chaining and Servlet context.
A.
True
B.
False
5 . Using mail API we can send the mail from a servlet.
A.
True
B.
False
6 . _______________ will store the session data.
A.
id objects
B.
session objects
C.
Application objects
7 . Debuging of servlet is done by Servlet log();
A.
True
B.
False
8 . Consider the following program: import myLibrary.*; public class ShowSomeClass { // code for the class... } What is the name of the java file containing this program?
A.
myLibrary.java
B.
ShowSomeClass.java
C.
ShowSomeClass
D.
ShowSomeClass.class
E.
Any file name with the java suffix will do
9 . Which of the following is TRUE?
A.
In java, an instance field declared public generates a compilation error.
B.
int is the name of a class available in the package java.lang
C.
Instance variable names may only contain letters and digits.
D.
A class has always a constructor (possibly automatically supplied by the java compiler).
E.
The more comments in a program, the faster the program runs.
10 . Consider the following code snippet String river = new String("Columbia"); System.out.println(river.length()); What is printed?
A.
6
B.
7
C.
8
D.
Columbia
E.
river
11 . A constructor
A.
must have the same name as the class it is declared within.
B.
is used to create objects.
C.
may be declared private
D.
A and B
E.
A, B and C
12 . Which of the following may be part of a class definition?
A.
instance variables
B.
instance methods
C.
constructors
D.
all of the above
E.
none of the above
13 . What is different between a Java applet and a Java application?
A.
An application can in general be trusted whereas an applet can't.
B.
An applet must be executed in a browser environment.
C.
An applet is not able to access the files of the computer it runs on
D.
A, B and C.
E.
None of the above
14 . Consider public class MyClass{ public MyClass(){/*code*/} // more code... } To instantiate MyClass, you would write?
A.
MyClass mc = new MyClass();
B.
MyClass mc = MyClass();
C.
MyClass mc = MyClass;
D.
MyClass mc = new MyClass;
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 . What is garbage collection in the context of Java?
A.
What is garbage collection in the context of Java?
B.
Any package imported in a program and not used is automatically deleted.
C.
When all references to an object are gone, the memory used by the object is automatically reclaimed.
D.
The JVM checks the output of any Java program and deletes anything that doesn't make sense.
E.
Janitors working for Sun MicroSystems are required to throw away any Microsoft documentation found in the employees' offices.
17 . You read the following statement in a Java program that compiles and executes. submarine.dive(depth); What can you say for sure?
A.
depth must be an int
B.
dive must be a method.
C.
dive must be the name of an instance field.
D.
submarine must be the name of a class
E.
submarine must be a method.
18 . JavaBeans define a Design time interface
A.
True
B.
False
19 . Beans are Java Classes that can be manipulated in a visual builder tool and composed into applications
A.
True
B.
False
20 . Bean methods can be called by other Beans or via scripting languages.
A.
True
B.
False
21 . Beans use _______ to communicate with other Beans
A.
Events
B.
Action
22 . RMI implementation is essentially built from ________ abstraction layers
A.
2
B.
4
C.
3
23 . The JVM has an automatic garbage collector that will reclaim the memory from any object that has been discarded by the running program.
A.
True
B.
False
24 . Can we access RMI from C++?
A.
True
B.
False
25 . Java language does not support
A.
Abstraction
B.
Polymorphism
C.
multiple inheritance
D.
Encapsulation
26 . Which abstract class is the super class of all classes used for reading bytes. Select the one correct answer.
A.
Reader
B.
FileReader
C.
ByteReader
D.
InputStream
E.
FileInputStream
27 . Which abstract class is the super class of all classes used for writing characters. Select the one correct answer.
A.
Writer
B.
FileWriter
C.
CharWriter
D.
OutputStream
E.
FileOutputStream
28 . Name the class that allows reading of binary representations of Java primitives from an input byte stream.
A.
DataBinStream
B.
DataReaderStream
C.
DataInputStream
29 . Which of these classes are abstract. Select the three correct answers.
A.
FilterWriter
B.
Reader
C.
InputStream
D.
CharArrayReader
E.
DataInputStream
30 . Name the exception thrown by the read method defined in InputStream class
A.
ReadException
B.
IOException
C.
InputException
Test Name :
Advance Java 2
Category :
Java
Number of Question :
30
Pass Score :
80
Test Result
Your Score :
Passing Score :
80
Result :
Copyright by
VanTuMinh
© 2007