<font color='#000000'><div align="left">there is not a big difference , the class could be one of
the application's many classes or it could be itself the
application if the application has only one class and there
is a diiference between a stand-alone application and
a GUI application ... the first oneis a text or command-line
the second is a graphical user interface
For using the new operator you do not have to use it
if the constructor does not do anything that affect the
performance of the methods in the class you want to
call from so if the and if all the class methods are static
whic means you can call them by only putting the name of the class
and the name of the desired method and a dot in between like this :
MyClass.printName();
or a predefined method Math.random();
and so on static basic meaning is that there is only one
refrence of the method or of the variable is used by every object of that class
lets say we have a 3 classes 2 of them instantiate that
one class and each one get a value of a static variable and set it to a value so the first object getting the value of that variable will get the original value which the developer of that class usually set to 0 ... ,,, suppose that object set this varible to 5 for example ...then the second oject call that same variable what value would it get for it?<img src="http://oasis.bindubai.com/emoticons/rock.gif" border="0" valign="absmiddle" alt='???'>?? it will get 5 because it is only one copy used by all the objects and the same works for the static methods....hope that solve the problem , but my advice for now is that you think of the static method or variable is that you can call them without instantiating their calsses using the way mentioned above and then when <img src="http://oasis.bindubai.com/emoticons/biggrin.gif" border="0" valign="absmiddle" alt=':D'> you go further in programming you will know the cool difference.....any how always nice questions ...keep the good work up
Regards....</div></font>
مواقع النشر (المفضلة)