JavaBeat
Search JavaBeat

Certification Kits
SCJP 1.5 Exam Questions
SCJP 1.6 Exam Questions
SCWCD 1.4 Exam Questions
SCWCD 5.0 Exam Questions
SCBCD 5.0 Exam Questions
SCJP 1.5 Links
scjp 1.4 home
scjp books
scwcd Books
objectives
mock exams
scjp 1.4 mock - 1
scjp 1.4 mock - 2
scjp 1.4 mock - 3
scjp 1.4 mock - 4
scjp 1.4 mock - 5
scjp 1.4 mock - 6
scjp 1.4 mock - 7
scjp 1.4 mock - 8
scjp 1.4 mock - 9
scjp 1.4 mock - 10
scjp 1.4 mock - 11
scjp 1.4 mock - 12
scjp 1.4 mock - 13
scjp 1.4 mock - 14
scjp 1.4 mock - 15
scjp 1.4 mock - 16
scjp 1.4 mock - 17
scjp 1.4 mock - 18
scjp 1.4 mock - 19
scjp 1.4 mock - 20
scjp 1.4 mock - 21
newbie
prometric center
Certification Links
SCJP 1.4
SCJP 1.5
SCJP 1.6
SCWCD 1.4
SCWCD 5.0
SCBCD 5.0
SCEA
SCEA 5.0
JavaBeat
Home
Articles
Tips
Code
QnA
Forums
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details
Mock Exam - 4
Q1 Which of the following are the correct form of documentation comments?
A1 //some text here
A2 /*some text here*/
A3 /**some text here*/
A4

all the above


Q2 State the correct formula for minimum/maximum values for integer primitives where no_of_bits is the size of the type in bits.
A1 2^(no_of_bits-1) / 2^(no_of_bits-1)+1
A2 2^(no_of_bits+1) / 2^(no_of_bits+1)+1
A3 2^(no_of_bits-1) / 2^(no_of_bits-1)-1
A4

all the above


Q3 Which of the following initializes boolean primitive?
A1 Boolean flag=true;
A2 boolean flag=true;
A3 boolean flag=TRUE;
A4

Boolean flag=TRUE;


Q4 which of the following is the correct way to define a class that will be in the default package
A1

package default;

import java.util.*;

 

A2 import java.util.*;

package default;

A3 import java.util.*;
A4

all the above


Q5 Which of the following main method in a java application is correct?
A1 public static void main(String[] args)
A2 public void main(String args[])
A3 public static void main (string[] args)
A4 final public static void main (String[] args)
A5 static public void main(String x[])
A6 static void main (string[] args)
A7 a and e only.
A8 g and d

Q6 Which of the following is default integer primitive
A1 short
A2 int
A3 byte
A4 char
A5 long

Q7 Which of the following is not a reserved word in java
A1 import
A2 finally
A3 friend
A4 goto

Q8 When writing a utility class, someclass, which extends mainclass class and will be used by several other classes in a large project. These other classes will be in different packages.Pick the correct class declaration
A1 class someclass extends mainclass
A2 protected class someclass extends mainclass
A3 public class someclass extends mainclass
A4

none


Q9 Which of the following variable names are invalid?
A1 example
A2 2sumup
A3 its4u
A4 $money

Q10

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

A1 one
A2 two
A3 three
A4 four
A5 none.
Answers
1 c
2 c Substitute no_of_bits = ( 8 for byte , 16 for short, 16 for char, 32 for int, 64 for long, 32 for float, 64 for double).We get (2^7) / (2^7) -1 for int and so on for other types
3 b primitive boolean keyword is 'boolean' and boolean can be only 'true' or 'false'

 

4 c. there is nothing like explicit declaration for default package. The class is added to default package if there is no package statement.
5 h Valid declaration for the main() method must be public and static, have void as return type and take a single array of String objects as arguments. The order of public and static keywords is irrelevant. Also declaring the method final does not effect the method's potential to be used as a main() method.
6 b
7 c . There are no friend functions as in C++.
8 c
9 b
10 b Array index start from 0. So somearray[0] points to the first element in the array.
350 Mock Questions on SCJP 1.5 - JUST Rs.200 or 7 USD
Send us mail to sales@javabeat.net
more details

Sponsors
Webmaster Hosting Forum
Java Jobs
Latest in DLinks
http://javawave.blogspot.com/2008/04/quartz-job-scheduler-part-ii-example.html
Quartz Job Scheduler -- Part 1 (Setting up development project in Netbeans 6.1 beta)
Flex Messaging with BEA Workshop Studio
SOA and Virtualization: How do They Fit Together?
Introduction to Enterprise Portals - Why they Benefit IT and the Business
BEA WebLogic Operations Control: Application Virtualization for Enterprise Java
Best Practices for Building Production Quality EAR Files
BEA's SOA Reference Architecture - A Foundation for Business Agility
Blueprint for Successful SOA Integration
Guardian - What a tool!

JavaBeat Media (2004-2008), India
javabeat home | About Us
our network : opensource softwares
Copyright © 2007 JavaBeat