Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Java Question What is Public, Static, void and main
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Mano Chithra
Java Question What is Public, Static, void and main
2 Answer(s)      6 years and 6 months ago
Posted in : Java Beginners


Can anyone please explain the meaning of public static and void main in Java?


Advertisement
View Answers

April 1, 2008 at 9:26 PM


Public - Means every user can use the method, class or variables whether it's a member or non member

Static - Value can't be changed

Void - not returnable

main - is a function to execute

(string args[])

string - datatype

and args[ ] - use to pass arguments


May 26, 2013 at 8:49 PM


public : to be searched by the JVM easily as public can be accessible from anywhere.

static: so that main method is loaded at the compile time with the class, because JVM searches the main method during run time, so we have to load main method at the class loading time means at compile time.

void: return type not to fix otherwise we had to return something.

main: name of the method.

String []arg :It is the parameters for main method of an Array of String type. Just String is used so that the application can take any type of input as every type of datatype can be converted into String easily.



Related Tutorials/Questions & Answers:
public static void main
public static void main  what is mean public static void main?  ... information, visit the following link: Understanding public static void main.... static-It indicates that the main() method is a class method. void- It indicates
JAVA what is different between static block and public static void main(String a[]) method
JAVA what is different between static block and public static void main(String a[]) method  what is different between static block and public static... block) why need of public static void main(String [])?   Static blocks
Advertisements
Static keyword in public static void main
= a * 4; } public static void main(String args[]) { meth(42); } } In the above...Static keyword in public static void main  Hi, I have seen... { static int a = 3; static int b; static void meth(int x) { System.out.println("x
Understanding public static void main function
Understanding public static void main function       The public static void main function is important.... Read more about public static void main function at http://www.roseindia.net
What is Public static void main
What is Public static void main In most of the Programming language, main... in java using main method. class Helloworld { public static void main(String... are the variation of main method. public static void main(String[] args) public
Why we are writting public static void main(String args[])?
Why we are writting public static void main(String args[])?  Why we are writting public static void main(String args[])? please elaborate it... and also explain the statement System.out.println("abc
What happen when we write static public void instead of public static void?
What happen when we write static public void instead of public static void?  Hi, What happen when we write static public void instead of public.../gettingstartedwithjava/public-static-void-main.shtml   Hi
Accessing non-static members through the main method in Java.
Accessing non-static members through the main method in Java.  ... it is permanently public static void... methods. If it is so, an obvious question arises as to how can the main() method
In Java, what's the difference between public, default, protected, and private?
In Java, what's the difference between public, default, protected, and private?  In Java, what's the difference between public, default, protected, and private
Why is the main method declared static?
Why is the main method declared static?  Hi, Why is the main method declared static? thanks   Hi, When we declare main() method in any Java class always has the same signature, and we declare public static void main
What are the main disadvantages of Java Server Faces 2.0?
What are the main disadvantages of Java Server Faces 2.0?  What are the main disadvantages of Java Server Faces 2.0
what is static synchronizes - Java Interview Questions
what is static synchronizes   what is static method...://www.roseindia.net/java/java-methods/java-method-synchronized.shtml http://www.roseindia.net/java/thread/synchronization.shtml Thanks
Can we replace main() with static block or with other static methods?
Can we replace main() with static block or with other static methods?  what is the use of public static void main()?can't we achieve the same thing through static block or through other static methods
Void class in Java - Java Beginners
Void class in Java  Hi, What is the purpose of Void class? Thanks   Hi Friend, It is an uninstantiable class that hold a reference to the Class object representing the primitive Java type void. Thanks
void Java Keyword
void Java Keyword       The void is a keyword defined in the java programming language. Keywords... in java programming language likewise the void keyword indicates the following
JSON main question
JSON main question  What is the main purpose of JSON ,in which cases can i use
JSON main question
JSON main question  What is the main purpose of JSON ,in which cases can i use
What is the arguement of main method?
What is the arguement of main method?  hi, What is the arguement of main method? thanks,   Hi, For main() method accepts only an array of String object as arguement. For moe details on http://www.roseindia.net/java
What is the importance of static variable?
What is the importance of static variable?  hi, What is the importance of static variable? thanks
What is the main feature of Hibernate3?
What is the main feature of Hibernate3?  What is the main feature... or local Java API, including a second-level cache browser. Eclipse support... timings as it supports inheritance, polymorphism, composition and the Java
What is the return type of the main method?
What is the return type of the main method?  hi, What is the return type of the main method? thanks   Hi, In the java programming the Main() method doesn't return anything hence declared void. In Java, you need
What do you understand by private, protected and public?
What do you understand by private, protected and public?   Hi, What do you understand by private, protected and public? thanks
What is static factory pattern?
What is static factory pattern?  Hello, please tell me what is static factory pattern? Thank you..   Dear friend, you can go through the following links to better understand the static factory pattern - Factory
static in java
static in java  what is the need to go static? what use
static & instance - Java Beginners
is: " + count); // } public static void main(String[] args... { private static int noOfObjects; private int count; public Main...static & instance  what is different between static variable
Main function.. - Java Beginners
Main function..  Hi Friend.. public static void main(String args[]) What does it mean...public - static - void - main -(String args[]) Can u plz...   Hi friend, public: The method can be accessed outside the class
What if the main() method is declared as private?
What if the main() method is declared as private?  Hi, What if the main() method is declared as private? Thanks   Hi, I have found some reference site for java programming coding for Main() method is declared
Public Java Keyword
Public Java Keyword       public is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java
How to Use Java Functions In EL
need three things. The java class with a static method. A Tag Library.... The java class: In this class the functions declared must be public and static. It should have a non- void type return type. After all, its all the matter
class static - Java Beginners
"); } public static void main(String[] args) { //i=100; j...; public static void staticMethod(){ System.out.println("you can access a static method this way"); } public void nonStaticMethod(){ i=100
core java, static - Java Beginners
"); } public static void main(String args[]) { Static st1 = new Static... ( Ultimately this is what we do in static main method). So is right to say.... //Static.java public class Static { static void stat() { Static st1
Advertisements
 

 

 

DMCA.com