The Artima Developer Community
Sponsored Link

Java Answers Forum
how & why static?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Joy

Posts: 15
Nickname: papai
Registered: Nov, 2003

how & why static? Posted: Nov 30, 2003 11:21 PM
Reply to this message Reply
Advertisement
How main function in java actually static,one concept i come to know
from Bruce Eckel that static member associate with class itself not
paricular instance of class.
However this code is not wrong :::(instead of be a infinite recursive loop)
public class testing
{
public static void main(String ar[])
{
testing t=new testing() ;
String s[]={"this","is","string"} ;
t.main(s) ; //instead of testing.main(s) ;
}
}
then question is that we can even create instance of testing to
access main.Then how to define static ?

Topic: what Java is so slow? Previous Topic   Next Topic Topic: Problem with my code

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use