freetests4u.com

Online knowledge sharing platform

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

1.
Which operator is used to check object type at run time ?

ternary operator
instance of operator
type operator
length operator
instance of operator
2.
Which is the valid declarations within an interface definition ?

public double method();
public final double method();
static void method(double d1);
protected void method(double 1);
public double method();
3.
Which operator is used by java to free the memory allocated to an object when the object is no longer needed ?

delete
free
new
None of these
None of these
4.
What is error in this code ? byte b=50; b=b*50

b can not contain this value,limited by its range.
type mismatch,cant convert from int to byte.
b can not contain value 50.
no error.
no error.
5.
Which one of the following conversion does not obeys WIDENING term ?

long to double
int to char
short to int
byte to long
int to char
6.
Which of the following is true ?

1. A class can extend more than one class
2. A class can extend only one class but many interfaces.
3. An interface can extend many interfaces.
4. An interface can implement many interfaces.
5. A class can extend one class and implement many interfaces.

1 and 2
2 and 3
3 and 4
3 and 5
3 and 5
7.
How many times wait method is defined in java.lang.Object class ?

1
2
3
4
3
8.
Variable of value type may get space on .........

Heap section
Non-heap section
Both A and B
None of above
Both A and B
9.
Which of the following is not valid ?

Multiple Interface Inheritance
Multiple Interface Implementation Inheritance
Multiple Implementation inheritance
Interface implementation Inheritance
Multiple Implementation inheritance
10.
Which of the following can be marked static ?

Methods,Variables and Initialization Blocks
Methods,Variables,Initialization Blocks and Outer Classes and nested Classes
Methods,Variables,Initialization Blocks and Outer Classes
Methods,Variables,Initialization Blocks and nested Classes
Methods,Variables,Initialization Blocks and nested Classes
11.
Which of these coding types is used for data type characters in Java ?

ASCII
ISO-LATIN-1
UNICODE
None of the mentioned
UNICODE
12.
Which of the following is the reference data type ?

int
short
double
array
array
13.
In Java, using how many ways we can pass object as an argument to the function ?

1
2
3
4
1
14.
Java uses ________ to represent characters

ASCII code
Unicode
Byte code
None of the above
Unicode
15.
What will be the output of following program ?

Class A
{
public static void main(String ...)
short a=10;
short b=20;
short res=a+b;
System.out.println("res :"+res);
}

10
20
30
Error
Error
16.
What are Wrapper classes ?

These are classes that allow primitive types to be accessed as objects.
These are classes that wraps functionality of an existing class.
Both of the above.
None of the above.
These are classes that allow primitive types to be accessed as objects.


CDAC CCAT Mock Tests

CDAC-CCAT test 1 (section A)

CDAC-CCAT test 2 (section A)

CDAC-CCAT test 3 (section A)

CDAC-CCAT test 4 (section A)

CDAC-CCAT test 5 (section A)

CDAC-CCAT English test (section A)

CDAC-CCAT test 1 (section B)

CDAC-CCAT test 2 (section B)

CDAC-CCAT test 3 (section B)

CDAC-CCAT test 4 (section B)