Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search Coderanch
Advance search
Google search
Register / Login
Ankur kothari
Ranch Hand
+ Follow
news
538
Posts
92
Threads
since Sep 06, 2009
Merit badge:
grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads
Recent posts by Ankur kothari
operator presedence
leave it...why dont either of you simply show me the calculation step by step...the answer is 16....maybe Ankit or Henry could explain properly
show more
15 years ago
Programmer Certification (OCPJP)
operator presedence
ok so correct me if am wrong
here x is 6;
x+=3 + ++x;
so Chandana according to you it would be x+=3+ 7; which evaluates to x+=10;
which is x=x+10;
which is x=10+7; right? or 10+6?
show more
15 years ago
Programmer Certification (OCPJP)
operator presedence
neha can you explain in detail?
show more
15 years ago
Programmer Certification (OCPJP)
operator presedence
so the output should be 17 right Chandana?
show more
15 years ago
Programmer Certification (OCPJP)
operator presedence
maybe its becasue the operands are evaluated from left to right....
i think this is x+= (AN_INT) + (++x).....first += is opened up soit is
its x=(x) + (AN_INT) + (++x)
this is simply so confusing
show more
15 years ago
Programmer Certification (OCPJP)
operator presedence
maybe its becasue its x*(7+5) becasue of that rule agian
show more
15 years ago
Programmer Certification (OCPJP)
operator presedence
then why is x*=7+5; not x=x*7+5; ?
show more
15 years ago
Programmer Certification (OCPJP)
operator presedence
int x=7; x*=7+5; wot is x now?
here x is 84....according to K&B right of += is calculated first...
so minhaj i think your answer should be x+=3+7; which is x=7+10...17
then why 16? hmmmm
show more
15 years ago
Programmer Certification (OCPJP)
operator presedence
i think its because of ( x += AN_INT)+((++x))) becasue +comes first in the hierarchy
show more
15 years ago
Programmer Certification (OCPJP)
converting int into char
here char one =1; is converted to char one=(char)1 by the compiler because 1 is a compile time constant....
if you had final int i=1;
char one=i; even this would compile because i is a compile time constant here too
but this casting isnt done when a compile time constant isnt present
show more
15 years ago
Programmer Certification (OCPJP)
String[] args
it wasnt a mock question....i was trying it myself....just thought of it
show more
15 years ago
Programmer Certification (OCPJP)
String[] args
show more
15 years ago
Programmer Certification (OCPJP)
String[] args
public class Yipee { public static void main(String [] args) { for(int x = 1; x < args.length; x++) { System.out.print(args[x] +" "); }}
why does java Yipee does not give me null pointer exception? whereas
public class Yipee { public static void main(String [] args) { String[] a=null; m(a); } static void m(String ar[]) { System.out.println(ar.length); } }
this does.....
show more
15 years ago
Programmer Certification (OCPJP)
Static method can't be overriden?
its ok
show more
15 years ago
Programmer Certification (OCPJP)
Static method can't be overriden?
dude the static method is inherited but does not follow overridden rules? like you cant refer to the subclass static method using superclass variable
show more
15 years ago
Programmer Certification (OCPJP)