freetests4u.com

Online knowledge sharing platform

CDAC-CCEE Java Mock test 2 (15 questions, time 15 minutes)

1.
If we add Enum constants to a sorted collection ( Treemap , TreeSet ), What will be the order in which they will be maintained ?

Sorted Collection wont maintain them in any order.
Insertion Order
Order in which constants are declared.
Natural Sorting Order.
Order in which constants are declared.
2.
java.util.Hashtable implement which of the following??

Java.util.Collection
Java.util.Map
Java.util.List
Java.util.HashTable
Java.util.Map
3.
What is default value of the local Variable ?

0
Garbage
Error
None of these
None of these
4.
Which of these is a mechanism for naming and visibility control of class and its content ?

Object
Packages
Interfaces
None of the above
Packages
5.
Which of the following conversion is valid conversion in narrowing ?

char to int
float to long
long to double
short to int
float to long
6.
What is the stored in the object obj in following lines of code?
box obj;

Memory address of allocated memory of object.
Garbage View
Any arbitrary pointer
0 (NULL)
0 (NULL)
7.
Which of these statement is incorrect ?

Every class must contain a main() method.
Applets do not require a main() method at all.
There can be only one main() method in a program.
main() method must be made public.
Every class must contain a main() method.
8.
Which of the following error never comes in java.

Compile time error
Linking error
Run time error
None of the above
Linking error
9.
Which of the following error never comes in java.

Compile time error
Linking error
Run time error
None of the above
Linking error
10.
A special method that is used to initialize a class object ?

Abstract method
Static method
Constructor method
Overloaded method
Constructor method
11.
If an expression contains double,int,float,long,then whole expression will promoted into which of these data types ?

long
int
double
float
double
12.
Which of the following is incorrect statement about packages ?

packages defines a name space in which classes are stored.
A package can contain other package within it.
Java uses file system directories to store packages.
A package can be renamed without renaming the directory in which the classes are stored.
A package can be renamed without renaming the directory in which the classes are stored.
13.
String a="abc "; System.out.println(a.length());

3
4
5
6
4
14.
Which of these is a mechanism for naming and visibility control of a class and its content ?

Object
Packages
Interfaces
None of the Mentioned.
None of the Mentioned.
15.
Which of these is an incorrect statement ?

it is necessary to use new operator to initialize an array
Array can be initialized using comma separated expressions surrounded by curly braces.
Array can be initialized when they are declared.
None of the mention
it is necessary to use new operator to initialize an array
16.
Which of the following method from super class which do not inherited in subclass ?

Constructor
Deconstructor
Copy constructor
None of these
Constructor


CDAC CCAT Mock Tests

CDAC CCEE java mock test 1 (15 questions, 15 minutes)

CDAC CCEE java mock test 2 (15 questions, 15 minutes)

CDAC CCEE java mock test 3 (15 questions, 15 minutes)

CDAC CCEE java mock test 4 (15 questions, 15 minutes)

CDAC CCEE java mock test 5 (15 questions, 15 minutes)

CDAC CCEE c++ mock test 1 (15 questions, 15 minutes)

CDAC CCEE c++ mock test 2 (15 questions, 15 minutes)

CDAC CCEE c++ mock test 3 (15 questions, 15 minutes)

CDAC CCEE OS mock test 1 (15 questions, 15 minutes)

CDAC CCEE OS mock test 2 (15 questions, 15 minutes)

CDAC CCEE OS mock test 3 (15 questions, 15 minutes)

CDAC CCEE database systems mock test 1 (15 questions, 15 minutes)

CDAC CCEE database systems mock test 2 (15 questions, 15 minutes)