Enter your search terms
Submit search form
Web
examineonline.googlepages.com
Online Exam
>>
Programming
>>
Java
>>
Java Practice 2
Menu
Programming
COMPTIA
GMAT
English
IQ
DataBase
OS
MCSE
CISCO
Finance
Management
Health
Soft Skills
Web Building
Multimedia
Java Practice 2
1 . Which of the following are primitive types?
A.
byte
B.
String
C.
integer
D.
float
2 . What is the range of the char type?
A.
long - 0 l
B.
float - 0.0 f
C.
double - 0.0 d
D.
char – null
3 . What is the value of 111 % 13?
A.
3
B.
5
C.
7
D.
9
4 . State true or false :- Can a double value be cast to a byte?
A.
True
B.
False
5 . State true or false:- Can a byte object be cast to a double value ?
A.
True
B.
False
6 . State true or false :- The conditional operator is otherwise known as the ternary operator.
A.
True
B.
False
7 . State true or false :- The do-while loop repeats a set of code atleast once before the condition is tested.
A.
True
B.
False
8 . State true or false :- A class is a template for multiple objects with similar features.
A.
True
B.
False
9 . State true or false :- All the classes in java.lang package are automatically imported when a program is compiled.
A.
True
B.
False
10 . State true or false :- Constructors can be overloaded like regular methods.
A.
True
B.
False
11 . Which of the following features are common to both Java & C++? (Select multiple)
A.
The class declaration
B.
The access modifiers
C.
The encapsulation of data & methods with in objects
D.
The use of pointers
12 . Which of the following statements can be used to describe a public method? (Select multiple)
A.
It is accessible to all other classes in the hierarchy
B.
It is accessablde only to subclasses of its parent class
C.
It represents the public interface of its class
D.
The only way to gain access to this method is by calling one of the public class methods
13 . Which of the following types of class members can be part of the internal part of a class? (Select multiple)
A.
Public instance variables
B.
Private instance variables
C.
Public methods
D.
Private methods
14 . You would use the ____ operator to create a single instance of a named class.
A.
new
B.
dot
C.
equals
D.
none of the above
15 . Which of the following statements correctly describes the relation between an object and the instance variable it stores? (Select multiple)
A.
Each new object has its own distinctive set of instance variables
B.
Each object has a copy of the instance variables of its class
C.
the instance variable of each object are seperate from the variables of other objects
D.
The instance variables of each object are stored together with the variables of other objects
16 . What are the functions of the dot(.) operator? (Select multiple)
A.
It enables you to access instance variables of any objects within a class
B.
It enables you to store values in instance variables of an object
C.
It is used to call object methods
D.
It is to create a new object
17 . When an object is referenced, does this mean that it has been identified by the finalizer method for garbage collection?
A.
True
B.
False
18 . Because finalize () belongs to the java.lang.Object class, it is present in all ___.
A.
objects
B.
classes
C.
methods
D.
interfaces
19 . Java's garbage collector runs as a ___ priority thread waiting for __priority threads to relinquish the processor. 1.high 2.low Choose the correct sequence
A.
1, 2
B.
1, 1
C.
2, 2
D.
2, 1
20 . When might your program wish to run the garbage collecter? (Select multiple)
A.
before it enters a compute-intense section of code
B.
before it enters a memory-intense section of code
C.
before objects are finalized
D.
when it knows there will be some idle time
21 . The default__ of objects protects private and trancient data, and supports the __ of the classes 1.evolution 2.encoding Choose the correct sequence.
A.
2, 1
B.
1, 2
C.
1, 1
D.
2, 2
22 . Which are keywords in Java? (Select multiple)
A.
NULL
B.
sizeof
C.
friend
D.
extends
E.
synchronized
23 . What is an example of polymorphism?
A.
Inner class
B.
Anonymous classes
C.
Method overloading
D.
Method overriding
24 . State true or false :- When a string literal is used in the program, Java automatically creates instances of the string class.
A.
True
B.
False
25 . State true or false :- Character literals are stored as unicode characters.
A.
True
B.
False
26 . The this reference is used in conjunction with ___methods.
A.
static
B.
non-static
C.
private
D.
protected
27 . State true or false :- For externalizable objects the class is solely responsible for the external format of its contents
A.
True
B.
False
28 . What modifiers may be used with top-level class?
A.
public
B.
abstract
C.
final
D.
all of the above
29 . State true or false :- Java compiler stores the .class files in the path specified in CLASSPATH environmental variable.
A.
True
B.
False
30 . Fill in the blanks :- When a program does not want to handle exception, the ______class is used.
A.
Throws
B.
Throwable
Test Name :
Java Practice 2
Category :
Java
Number of Question :
30
Pass Score :
80
Test Result
Your Score :
Passing Score :
80
Result :
Copyright by
VanTuMinh
© 2007