| | |
static
![]() |
•
•
Join Date: Aug 2007
Posts: 63
Reputation:
Solved Threads: 0
static in simple words means that we are not able to use instance variables(the class variabes)which don't have the word static in the main method or invoking other methods those don't have the word static also in the main method.
you will ask me why??
I will tell you that because the main method has the word static.
you will tell me I don't understand ,..ok fine look at this now, you can create an object in the same class you are working with in the main method to call the methods that don't have the word static by this statment ( object name.metthod name) you will notic that the program runs without any problem why because of the object you created also you can use in the main method the class variables that don't have the word static by (object name . class variable) why again because of the object. however the methods those don't have the word static they are able to use the variable class because they don't have the word static.so what does static mean? it means that no need to create the object as long as both the method and class variables share the same word static
also it means that no need to create object as long as the two methods are static(the first calls the other by mentioning the function name)
hope you understand .
please reply me if not.
thank you.
you will ask me why??
I will tell you that because the main method has the word static.
you will tell me I don't understand ,..ok fine look at this now, you can create an object in the same class you are working with in the main method to call the methods that don't have the word static by this statment ( object name.metthod name) you will notic that the program runs without any problem why because of the object you created also you can use in the main method the class variables that don't have the word static by (object name . class variable) why again because of the object. however the methods those don't have the word static they are able to use the variable class because they don't have the word static.so what does static mean? it means that no need to create the object as long as both the method and class variables share the same word static
also it means that no need to create object as long as the two methods are static(the first calls the other by mentioning the function name)
hope you understand .
please reply me if not.
thank you.
![]() |
Similar Threads
- static ip? (Networking Hardware Configuration)
- Airport, static route, find ip - Please Help!!!? (Networking Hardware Configuration)
- static compile (Visual Basic 4 / 5 / 6)
Other Threads in the Java Forum
- Previous Thread: Non-Static method cannot be referanced from a Static context
- Next Thread: visualization
| Thread Tools | Search this Thread |
-xlint add android api applet application applications array arrays automation bank bi binary blackberry bluetooth chat class client code compile compiler component database development digit eclipse equation error event fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image infinite input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying pearl problem program programming project qt recursion scanner screen scrollbar server set sms sort sorting spamblocker sql sqlserver string superclass swing system text-file thread threads tree variablebinding windows xor





