Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web

anilbachi SCJP Practice Exams

chapter1 | chapter2 | chapter3 | chapter4 | chapter5 | chapter6 |

chapter7 | chapter8 | chapter9 | chapter10 | chapter11 |

chapter 1: Language Fundamentals Questions ( page 2 of 3 )

Page 1 | page 3

click to tell a friend about this resource

Q12:Which of the following initializes boolean primitive?

a). Boolean flag=true;

b). boolean flag=true;

c). boolean flag=TRUE;

d). Boolean flag=TRUE;

 

Q13: Take a look at the following code:

public static void main (String[] args){

System.out.println(args[1]);

}

The above is compiled and then executed by the following command line.

java test one two three four

choose the correct output

a). one

b). two

c). three

d). four

e). none

 

Q14: Which of the following value falls in byte primitive?

a). 129

b). -129

c). 128

d). 127

 

Q15: Select the correct statements?

a). char and int primitives are 16 bit

b). int and float are 32 bit

c). float and double are 64 bit

d). long and double are 64 bit

 

Q16: Which of the following is not a valid top level class?

a). public class topclass

b). static class topclass

c). private class topclass

d). all the above

e). a and b

 

Q17: An example unicode value is '0x3c0' in hexadecimal.

Which of the following correctly initializes the char primitive to the pi?

a). char pi='u3c0';

b). char pi='\u03c0';

c). char pi="\u03c0";

d). char pi='\x03c0';

 

Q18: State the reason for a compile error caused by the following statement

String name="summertime \u00d wintertime";

a]. escape sequences for unicode characters should not be embedded in String literals

b]. escape sequences inserts the code for a line terminator. Line terminators are not allowed between opening and closing quotes

c]. '\u00d' is not a valid unicode character

d]. none of the above

 

Q19: The term deprecated refers to the classes and methods that are not safe to use

a]. true

b]. false

 

Q20: Number of bits in a java double primitive

a]. 0 bits

b]. 48 bits

c]. 32 bits

d]. 64 bits

 

Q21: Which of the following is true

a]. a class level int primitive is automatically initialized to 0

b]. a class level boolean primitive is automatically initialized to false

c]. a local boolean primitive is automatically initialized to false

d]. all the above

 

Q22: An automatic variable becomes eligible for garbage collection when it goes out of scope

a]. true

b]. false

Page 1 | page 3

 

Click here for solutions

Banner 10000063

 

©Copyrights anilbachi.8m.com All rights reserved

for queries contact anil_kuchana@yahoo.com