Home Answers Viewqa Java-Beginners main function defnition in class

 
 


naren
main function defnition in class
2 Answer(s)      4 years and 6 months ago
Posted in : Java Beginners

View Answers

December 30, 2008 at 10:42 PM


Hi friend,

The main method is similar to the main function in C and C++; it's the entry point for your application and will subsequently invoke all the other methods required by your program.

The main method accepts a single argument: an array of elements of type String.

public static void main(String[] args)


Thanks

January 2, 2009 at 12:12 PM


hi,

we use public because we can use that method(main) not only in the current directory.

That is please refer "Pakages" concept.

.............
chandrakanth.k









Related Pages:
main function defnition in class - Java Beginners
main function defnition in class  why do we use public infront of a main function   Hi friend, The main method is similar to the main function in C and C++; it's the entry point for your application
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
main function
main function  Give me the description of public static void main(Strings args
Understanding public static void main function
Understanding public static void main function       The public static void main function is important function in Java programming language. In this section we will learn about main
How I call the function union from the main - Java Interview Questions
How I call the function union from the main  Please, from public static void main(String[] args) I would like to call the function union and I... declared in main function //------------------------------- package model
Class
there are two classes has been used except the main class in which the main function... is using two classes. First class is another and second is the main class which... Class, Object and Methods     
What is Public static void main
in java using main method. class Helloworld { public static void main(String...What is Public static void main In most of the Programming language, main function is the first function where program start execution. This is the first
main function in java - Java Interview Questions
main function in java  1....why is function main() define as static in java? 2...drawbacks of using rmi
unoin function
sets. import java.util.*; public class SetsUnion { public static void main...unoin function  how to define a union function in java?(ex:a=a U b) how to write tha java code?give ex.   Java Union Function You have
main method
can not make multiple main with in the same class program fails to compile. Compiler gives error that the main method is already defined in the class...main method  hello, Can I make multiple main methods in the same
function method
function method  i. void display(String str.int p)with one string... is an example where we have created a function that accepts a string and an integer... java.util.*; class FunctionExample { void display(String str,int p){ if(p==1
Main function parameter in C language - Ajax
Main function parameter in C language  Please let me know how this Main(int argc,char*argv[]) works and detailed example on their roles in command...; Hi Friend, int main(int argc, char **argv) The main function serves
MAin error
but @ d tym of runnin error in main class is generated Exception in thread "main".java.lang.NoClassFoundDefLoader. : Hello caused...MAin error  Error while running hello program in another dir rather
using function
(){ } } public class VowelsAndConsonants{ public static void main(String... class VowelsAndConsonants{ public static void main(String[] args)throws...using function  write a program using function overloading to accept
main method
is a class method. void- It indicates that the main() method has no return value...main method  psvm(String args[]) what does this arguement in paranthesis denote?   Hi Friend, public-It indicates that the main() method
About Main
About Main  can u create the object of one interface ? But i can able to create the abstract class through anonimous inner class.similarly can i
About Main
About Main  can u create the object of one interface ? But i can able to create the abstract class through anonimous inner class.similarly can i
could not find the main class programm will exit - error
could not find the main class programm will exit - error  when i... main class programm will exit. class Car { String name: String Color...); System.out.println("Number of the Car is: " + num); } public static void main
Append Function in Java
Append Function in Java  What is the use of append function in java? How to use the append function to append a string to a buffer string. Thanks   You can use the StringBuffer class in Java to efficiently append
main func - Java Beginners
main func  why do we pass array of strings in main function of java?  Hi Friend, It is used to signify that the user may opt to enter parameters to the java program at command line. Thanks
function arguments in java
function arguments in java  function arguments in java   Command line argument in Java import java.util.*; public class SumAndAverage{ public static void main (String [] arg) { Scanner scan = new Scanner (System.in
public static void main
public static void main  what is mean public static void main?   public-It indicates that the main() method can be called by any object. static-It indicates that the main() method is a class method. void- It indicates
Can a main method be overloaded?
Can a main method be overloaded?   Hi, Can a main method be overloaded? thanks,   Hi, Yes, In Java program we could having multiple number of main() methods with different Signature and implementation in the class
main() syntax - Java Beginners
] [import statements] [class declaration] [main() method] For Example: package roseindia; import java.lang; class Hello{ public static void main(String...main() syntax  Hi, I would like to know the complete structure
Load function ***PLEASE HELP
Timmerman */ public class Main { public static void main(String[] args...Load function ***PLEASE HELP   Hi I am writing a program that tracks... function that loads a file. The save function prompts the user to enter
Exception in thread "main" java.lang.ClassCastException
){e.printStackTrace();} } } public static void main(String[] argv) { try { Class driver...Exception in thread "main" java.lang.ClassCastException  I am trying...*; public class Test_jdbc { public Test_jdbc() { } // executes single SQL query
Exception in thread "main" java.lang.ClassCastException
){e.printStackTrace();} } } public static void main(String[] argv) { try { Class driver...Exception in thread "main" java.lang.ClassCastException  I am trying...; public class Testjdbc { public Testjdbc() { } // executes single SQL query public
JPA Count Function
: Product.java Main Class: JPACountFunction.java Database Table: product CREATE...) { this.price = price; } } Main Class... JPA Count Function      
problem with main - Java Beginners
*; public class YellowFace extends JApplet { public static final int FACE... a problem. when i compile it appears this message: java.lang.NoSuchMethodError: main Exception in thread "main" . Should i put a main in another file? And how can
java main program
java main program  how to write a main program for the following code public class JaroWinkler { private String compOne; private String compTwo; private String theMatchA = ""; private String theMatchB
Can I have multiple main() methods in the same class?
Can I have multiple main() methods in the same class?  Hi, Can I have multiple main() methods in the same class?   Hi, No, We cann't use multiple main() method within the same class. If we do this then the program
what is the correct format of charAt() function?
what is the correct format of charAt() function?  class prog...:"+count); } } class p3{ public static void main(String ar[]){ prog obj...:class prog if(charAt(i)=='a'){ ^** But the syntax of the charat
Java arraylist index() Function
. Example of Java Arraylist Index() Function import java.util.ArrayList; import java.util.List; public class List1 {     public static void main(String[] args) {       List list=new ArrayList();          list.add("aaa
How to eliminate error," Could not find the main class: filecopy.FileCopy. Program will exit." ?
How to eliminate error," Could not find the main class: filecopy.FileCopy....) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: filecopy.FileCopy. Program will exit. Exception in thread "main" Java
sum and avg function using HQL.
org.hibernate.SessionFactory; public class DistinctCountHQL { public static void main(String[] args...sum and avg function using HQL.  How to use sum and avg function... of them. sum() function returns summation of specified field in the table
JPA Sum Function
the following files: Database Table: product Model Class: Product.java Main Class...; } } Main Class: JPASumFunctoion.java... JPA Sum Function      
Hibernate min() Function
pool and required environment setup. Finally created a main class where I shall...Hibernate min() Function This section contains an example of the HQL min() function. min() function in HQL returns the smallest value from the selected
When is java main method called?
;In a java class, main(..) method is the first method called by java environment when..., the runtime system starts by calling the class's main() method. The main() method...When is java main method called?  When is java main method called
calling zipping function - JSP-Servlet
*; import java.util.zip.*; public class ZipCreateFile{ public static void main... file. I wrote a java function for zipping a file.How to call that java file (zipping function ) in JSP ? pls help me Thanks.... 
JPA Mod Function
Class: Product.java Main Class: JPAModFunction.java Database Table: product... JPA Mod Function       In this section, you will learn about the jpa mod function
JPA Upper Function
Table: student Model Class: Student.java Main Class: JPAUpperFunction.java...; } } Main Class: JPAUpperFunction.java /** * ... JPA Upper Function     
call a function - Java Interview Questions
call a function  Please i want to call the function union via main... class Relation { public boolean[][] matrix; private boolean...; } public static void main(String[] args) { Relation relation = new
JPA Substring() Function
: Database Table: student Model Class: Student.java Main Class...; } } Main Class: JPASubStringFunction.java... JPA Substring() Function   
JPA Trim() Function
: Student.java Main Class: JPATrimFunction.java Database Table: student...) { this.scourse = scourse; } } Main Class... JPA Trim() Function     
JPA Lower() Function
Main Class: JPALowerFunction.java Database Table: student...) { this.scourse = scourse; } } Main Class... JPA Lower() Function     
JPA Length Function
: Database Table: student Model Class: Student.java Main Class...; } } Main Class: JPALenghtFunction.java... JPA Length Function     
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 is the return type of the main method?
to have a method named main in at least one class. The following is what must...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
Main Thread and Child Thread
There are two types of threads in Java Progarm In Java there are Main and Child Threads used in Programming. Main thread is automatically created when program runs. Child Thread gets created by the main thread . Java Main
JPA Max Function
artifacts: Database Table: product Model Class: Product.java Main Class...; } } Main Class: JPAMaxFunction.java... JPA Max Function