This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!

Priya Jaspal

Greenhorn
+ Follow
since Jan 29, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Priya Jaspal

String a = 'a'; //1
String c = '\u0041'; //2
String e = 'abcd'; //3
String b = 'abc'; //4


When i am trying to compile the above code ,It showing error in line 3 not in line line4.

but if i replace line3 with line4 ..like this

String a = 'a'; //1
String c = '\u0041'; //2
String b = 'abc'; //3
String e = 'abcd'; //4

Now ,also its showing error with line3.....

I am not able to understand the logic behind this.
Can somebody help me out..?






Yeah...Now I understood.

-4 will be the correct answer.

Thanks a lots!
I know that 1100 is 12 in decimal number system.
But 12 is not at all there in options.

So,Can you be more clear?

Hi Ankit,

I have done editing with my post.
Hope its fine now...If still there is any problem then please let me know.

I know this type of question will not be asked in SCJP1.5.
But i found it somewhere.
I know the answer but wondering on it.
I will be grateful if it will be answered.
Hi..

What gets printed when the following program is compiled and run. Select the one correct answer and provide the clarification please...


public class test {
public static void main(String args[]) {
byte x = 3;
x = (byte)~x;
System.out.println(x);
}
}


1. 3
2. 0
3. 1
4. 11
5. 252
6. 214
7. 124
8. -4

Source:This question was asked in a Java Mock test on net.