• Post Reply Bookmark Topic Watch Topic
  • New Topic

help me in kicking off the bug from the following code  RSS feed

 
Akshay Kumar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
abstract class second {
int i;
abstract void setValue (int);
int getValue () {
return i;
}
abstract void printValue ();
}
public class first extends second {
static first f = new first();
public first() {
}
static public void main(String[] args) {
System.out.println("Hello");
f.setValue (10);
f.printValue();
}
void setValue (int iValue) {
i = iValue;
}
void printValue () {
System.out.println("Value of i ::: " + f.getValue ());
}
}
 
David Peterson
author
Ranch Hand
Posts: 154
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!