Monday, June 04, 2007
What would happen when tried to compile and run this program?
2. Runtime Error.
3. Compiles and Runs with no errors.
Answer : 1
1. Compilation Error
public class StaticVar
{
void execute(String b){
static String str;
str = b;
}
public static void main( String[] args ) {
StaticVar var = new StaticVar();
var.execute( "blah");
}
}
2. Runtime Error.
3. Compiles and Runs with no errors.
Answer : 1
Labels: java questions