Jai007

Greenhorn
+ Follow
since Aug 13, 2002
Merit badge: grant badges
For More
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 Jai007

If the purpose of synchronization is to provide controlled serialised access by different threads(correct me if I am wrong)then what is the logic of the following restriction:
&&&
Variables and classes cannot be synchronized. Any code block within a method can be synchronized by enclosing it in {}.
Can somebody help me understanding the following outcome!!
&&&
public class Test {
public static void main(String args[]) {
StringBuffer a = new StringBuffer("One");
StringBuffer b = new StringBuffer("Two");
Test.swap(a,b);
System.out.println("a is "+ a +"\nb is " + b);
}
static void swap (StringBuffer a, StringBuffer b) {
a.append(" more");
b=a;
}
}
What will be the output?
Answer:
d. a is One more
b is Two
what does (i==1 &| j==2) means!!
Difference between keywords or reserved words in Java?
Help me understand the following logic:
&&&&
TextField t = new TextArea("12345", 5, 5);
why following statement is false?
C. The maximum number of characters in a line will be five.
In view of Answers to 108 & 23 how can answer to 3 can be still true:
&&&
Answer to Question 108
1)
char c='1';
System.out.println(c>>1);
The fact that option 1 will compile may be a surprise, but although the char type is normally used to store character types, it is actually an unsigned integer type. The reason option 3 does not compile is that Java has a >>> operator but not a <<< operator.
Will NOT compile.
Answer to uestion 23)
2)s+=i;
Only a String acts as if the + operator were overloaded
Answer to Question 3)
2) int i=2+'2';
3) String s="on"+'one';
Option 3 is not valid because single quotes are used to indicate a character constant and not a string. Several people have emailed me to say that option 3 will compile. When they eventually compiled the exact code they have agreed, it will not compile.