Friday, September 4, 2009

SCJP Questions

Exhibit :
1 public class test (
2 private static int j = 0;
3
4 private static boolean methodB(int k) (
5 j += k;
6 return true;
1 )
2
3 public static void methodA(int i) {
4 boolean b:
5 b = i < 10 | methodB (4);
6 b = i < 10 || methodB (8);
7 )
8
9 public static void main (String args[] } (
10 methodA (0);
11 system.out.printIn(j);
12 )
13 )
What is the result?
A. The program prints "0"
B. The program prints "4"
C. The program prints "8"
D. The program prints "12"
E. The code does not complete.
Answer: B

0 comments:

Post a Comment

 

About

Site Info

Information Source

Academy of JAVA by Rajesh Rolen Copyright © 2009 Community is Developed by Rajesh Kumar Rolen WebSite

/* tracking code by yahoo login */