fraternity lawson

Greenhorn
+ Follow
since Mar 11, 2001
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 fraternity lawson

public class Syntest{
public static void main(String []args){
final StringBuffer s1=new StringBuffer();
final StringBuffer s2=new StringBuffer();
new Thread(){
public void run(){
synchronized(s1){
s1.append("a");
synchronized("b"){
System.out.println(s1);
System.out.println(s2);
}
}
}
}.start();
new Thread(){
public void run(){
synchronized(s2){
s2.append("c");
synchronized(s1){
s1.append("d");
System.out.println(s2);
System.out.println(s1);
}
}
}
}
.start();
}
}
a)print ABBCAD
b)print CDDACB
c)print ADCBADBC
d)The output is a not-deterministic point because of a
possible deadlock condition
e)The output is dependent on the threading model of
the ysstem the program is running on.
What could be the output of this question?.I go with D,E,correct me if i am wrong.
Is the following statement true for the class java.util.HashSet?
The elements in the collection are guaranteed to be unique?.
All the Wrapper classes are immutable or not?
jone,I think that does not answer my question.
hello,
Why does the following code is showing an error

public class sum
{
public static void main(String[]args)
{

byte[] array1,array2[];
array2=array1;
}
}

Congrats,u are very,very lucky person.There are people who have failed just because they got one mark less than the passing mark's.Go and enjoy,have a nice time.
23 years ago
public class rodney
{
public static void main(String[]args)
{
int b = -11; // 11111111 11111111 11111111 1111 0101
b = b >> 2; // 11111111 11111111 11111111 1111 1101 (2's complement of -3)
System.out.println(b);
}
}
How the output is coming -3.?
The piece of preliminary analsis work describes a class that will b
e used frequently in many unrelated parts of a project:
"The polygon object is a drawable,A polygon has vertex information sto
red in a vector,a color,
length and width."
Which Data type would be used?
A.int B.Vector C.String D.Color E.Date
Let me know the right one,state the resoning behind your chosen one.
Question removed ... it was identified as being a real exam question... Jane
Let me know the right one,state the resoning behind your chosen one.

[This message has been edited by Jane Griscti (edited May 12, 2001).]
public class fun
{
public static void main(String[]args)
{
int i=0;
for(;i<10 ;
{
System.out.println("what r u doing");
}
}
}
Why the above code do not show any output.?
Will u please let me know whether an error is a runtime exception or not.
ANSWER TRUE/FALSE.
A)If only one thread is blocked in the wait method of an object and another thread
execute the notify method on that same object, then the first thread immediately
resumes execution.
B.) If a thread is blocked in the wait method of an object, and another thread executes
the notify method on the same object, it is still possible that the first thread might
never resume execution.
C.) If a thread is blocked in the wait method of an object, and another thread executes
the notify method on the same object then the first thread definitely resumes execution
as a direct and sole consequence of the notify call.

d)If two thread are blocked in the wait method of an object, and another thread
executes the notify method on the same object then the thread that executed the wait
call first definitely resumes execution as
a direct and sole consequence of the notify
call

THE ABOVE GIVEN QUESTION IS FROM PONY MOCK EXAM.LET ME KNOW THE CORRECT ONE'S.TO ME B OPTION SEEM'S TO BE CORRECT BUT NOT SURE,LET ME KNOW THE CORRECT ONE'S.
You are right in that question, surely 2 will not throw an exacption.Just compile and make sure who is right and who is wrong.
An AWT GUI under exposure condition,which one or more method will b
e invok when it redraw?
A.paint(); B.update(); C.repaint(); D.drawing();
I think repaint will call update which in turn will call paint().Do let me know if am wrong.
What wight cause the current thread to stop excutings?
A.thread of higher priority become ready. B.method sleep() be called.
C.method stop() be called D.method suspend() be called.
E.method wait() be called

c,b,d,e seem's to be the right answer's.Option A depend's on the platform.Do let me know whether the selected answer's are right or wrong.