closepop
closepop

Would you like to submit the test?


Java :

Language Fundamentals




1.
Which four options describe the correct default values for array elements of the types indicated?

int -> 0
String -> "null"
Dog -> null
char -> 'u0000'
float -> 0.0f
boolean -> true

1,2,3,4
1,3,4,5
5,4,3,2
1,3,5,4




2.
Which one of these lists contains only Java programming language keywords?

class, if, void, long, Int, continue
goto, instanceof, native, finally, default, throws
try, virtual, throw, final, volatile, transient
strictfp, constant, super, implements, do




3.
Which will legally declare, construct, and initialize an array?

int [] myList = {"1", "2", "3"};
int [] myList = {"5", "8", "2"};
int [] myList = {"1", "4", "3"};
int [] myList = {"4", "3", "7"};




4.
Which is a reserved word in the Java programming language?

method
native
subclasses
array




5.
Which is a valid keyword in java?

interface
string
float
unsigned




6.
Which three are legal array declarations?

int [] myScores [];
char [] myChars;
int [6] myScores;
Dog myDogs [];
Dog myDogs [7];

1,2,4
1,4,2
1,2,3
3,2,1




7.
public interface Foo 
    int k = 4; /* Line 3 */
}
Which three piece of codes are equivalent to line 3?
final int k = 4;
public int k = 4;
static int k = 4;
abstract int k = 4;
volatile int k = 4;
protected int k = 4;

1,2,3
3,2,1
1,3,2
2,3,1




8.
Which three are valid declarations of a char?

char c1 = 064770;
char c2 = 'face';
char c3 = 0xbeef;
char c4 = u0022;
char c5 = 'iface';
char c6 = 'uface';

2,3,1
1,3,6
4,6,1
6,3,2




9.
What is the numerical range of a char?

0 to 65543
0 to 60000
0 to 65342
0 to 65535




10.
Which three are valid declarations of a float?

float f1 = -343;
float f2 = 3.14;
float f3 = 0x12345;
float f4 = 42e7;
float f5 = 2001.0D;
float f6 = 2.81F;

2,3,4
2,0,1
1,3,6
2,1,4










FreshersLive - No.1 Job site in India. Here you can find latest 2016 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.


FreshersLive - No.1 Job site in India. Here you can find latest 2016 government as well as private job recruitment notifications for different posts vacancies in India. Get top company jobs for both fresher and experienced. Job Seekers can get useful interview tips, resume services & interview Question and answer. Practice online test free which is helpful for interview preparation. Register with us to get latest employment news/rojgar samachar notifications. Also get latest free govt and other sarkari naukri job alerts daily through E-mail.