Ankith suresh

Ranch Hand
+ Follow
since Jun 07, 2007
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 Ankith suresh

Hi guys
I am certified with 96%.
Thanks everybody for the help
16 years ago
Will % of mark mentioned in certificate?
Where it will be mentioned?
int intNumber = 123456789;
float floatNumber = intNumber;
int x = (int)floatNumber;
System.out.println(intNumber - x);
I m geting result -3 .how?
Hi,

x---x/0

does it mean x- --x/0 or x-- -x/0???
Output is indetermind ..right?
Bcz System.gc() don't force garbage collection.
am i right??
I am getting this error....in 1.4
why?


---------- compiler ----------
ab4.java:8: a4 is not abstract and does not override abstract method method() in a4
class a4 extends base4
^
1 error

Output completed (59 sec consumed) - Normal Termination
class Opr
{

static boolean method1(boolean b){
System.err.println("in 1");
return b;
}
static boolean method2(boolean b){
System.err.println("in 2");
return b;
}

static boolean method3(boolean b){
System.err.println("in 3");
return b;
}

public static void main(String[] args)
{

boolean b = method1(true) && method2(false) & method3(true) ;
// System.err.println(b);

}

}


& has more priority than &&
so its has to print
in 2
in 3
in 1

but output is
---------- intepreter ----------
in 1
in 2
in 3

Output completed (0 sec consumed) - Normal Termination

How ??
Hi john
But We can have static members in "Static Inner class"
"if enclosing class does not have any static/final member" ???

What does
"if enclosing class does not have any static/final member" ???
meant???
If second operand is -ve in a shift operator
How the bit will be shifted?
Eg : 2>>-1
Hi,
why not
B: public synchronized void run() {write();}
C: public void run() { synchronized(this){ write();}}
Hi,
You mean both short circuit (&&,||) and (&,|) operate from left to right.
Don't consider the priority???
But
( (b = m1(true)) && (c = m1(false))

have higher priority bcz it is in paranthesis ()
Hi,

class EBH202 {
static boolean m1(boolean b){
System.err.println(b+",");
return b;
}

static boolean a, b, c;
public static void main (String[] args) {
boolean x = (a = m1(true)) ||( (b = m1(true)) && (c = m1(false)));
System.out.print(a + "," + b + "," + c);

}
}

---------- intepreter ----------
true,
true,false,false
Output completed (0 sec consumed) - Normal Termination

i am geting this output .
I put the paranthesis to change the priority
I thot
( (b = m1(true)) && (c = m1(false)) this will excute first
Pls explain
Hi Greg

if("String".replace('g','G') == "String".replace('g','G'))

in above code

1. first operand "String".replace('g','G') == --> This will create new Object ie "StrinG"
2. second operand "String".replace('g','G') --> This will also create object ie "StrinG"
My doubt is the object created in line 2 allready exist in the pool.In that case will it create a new object