Static means that something is done at compile time instead of when the object is instantiated, so you would therefore call a static method (doSomething()) through the class name rather than the object name.
class A{
public static void B(){
}
public void C(){
}
}
Let's say A instance = new A();
To access B you would say A.B(), while to access C you would say instance.C();
if some method is static, then you can not call that method through the oobject of that class. but the name of the class. let us see a example: class Test { int a; int b; static void show() { System.out.println("we are in show"); } } class Main { public static void main(String args[]) { Test t=new Test(); t.show();\\thiss is an erroraneous code. because, the method "show()" is static. Test.show();\\this is correct } Arnas Sinha
Static is a keyword,when u execute a method in class file loaded, execute the first this method..
native is a key word used in java method. there is no variable as native in java
Because main is the first method being executed, the Java Virtual Machine cannot expect any return values from this method. Since void is the term used to refer to a variable that does not return any value, we use the key word void for the method signature of the main method
Class hindi { public static void main() { char c; for(c=2309;c<2362;c++) { System.out.println(" "+c); } } }
fixed method means is one which cannot be overridden by a subclass. A fixed method can be declared by prefixing the word-final before a method. We can use the keyword final to donate a constant.
java
Check the documentation of the String class, for a method that searches for a substring.
Do you mean something like this: static void Print (const char *s) { puts (s); } int main (void) { Print ("a word"); return 0; }
When we want that a class member should be used independently of any object of that class, we have to precede that member's declaration with the keyword static .When a member is declared as static, it can be acccessed without creationg an object of the class and without referring to the object.That static is , a static member belons to a class as a whole and not to any one instance/object of that class.The static member is shared by all objects of thatclass.
nextLine() reads a complete line while next() reads the next token ( a single word)
Java is an island in Indonesia, but in slang it means coffee.