Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static method query?

 
kiran kumar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
class A{
static void methodA(){
System.out.println("in methodA");
}
public static void main(String ar[]){
A a1=new A();
a1.methodA(); //when we have to use this one
A.methodA(); //when we have to use this one

}
 
Rodrigo Lopes
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read this
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic