GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Placement Papers  >  Oracle  >  Java

 Print  |  
Question:  public class A {

int x;

public static void main(String args[]) {

x=x+1;
s.o.p(x);
}
}

what is the output?
a) compile time error
b) runtime error




August 08, 2007 04:37:44 #4
 satyanarayana   Member Since: Visitor    Total Comments: N/A 

RE: public class A {int x; pub...
 
Compile time error
In that program int x is an nonstatic variable we can't call directly with static method
     

 

Back To Question