dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Advanced
Feb 1, 2001

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Why Static Methods Can Only Make Calls to Static Methods


Write the following code, compile it, then try to run it:
 
class TstApp

public static void main (String args[])

Next_Level(args[0]);
}

public void Next_Level(String Incoming_String)

System.out.println(Incoming_String);
}
}

It is very simple code but it will not work. This is because, in the parent class, main is a static method whereas Next_level() is not a static method.
Shantanu Garg
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date