main function defnition in class

main function defnition in class

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 Tutorials/Questions & Answers:
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
main function  Give me the description of public static void main(Strings args
Advertisements
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
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
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
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
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
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
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
Class and interface in same file and accessing the class from a main class in different package
Class and interface in same file and accessing the class from a main class... a class named CantFly in same file. A main method CheckAnimal.java. Below... class CheckAnimals { public static void main(String[] args) { Animal
Class and interface in same file and accessing the class from a main class in different package
Class and interface in same file and accessing the class from a main class... a class named CantFly in same file. A main method CheckAnimal.java. Below... class CheckAnimals { public static void main(String[] args) { Animal
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
how to call java script function through java class file
how to call java script function through java class file  how to call jframe in java script
What is Public static void main
a instance of main Class, constructor can be overloaded and can have arguments... program how to write a program in java using main method. class Helloworld...What is Public static void main In most of the Programming language, main
how to pass variable from simple java main class(not servlet) to the jsp page?
how to pass variable from simple java main class(not servlet) to the jsp page?  I have a simple Java class in which I invoke a call to a JSP page... from the simple Java class to the JSP page. How can I do that? Here is my
function
function  difference between function overloading and operator overloading
.jar file keeps giving me " could not find the main class". Program will exit.
.jar file keeps giving me " could not find the main class". Program will exit... netbeans's project properties clearly sets testing2.hihi as my Main class and I have... click on it, it gives me the message" could not find the main class. Program
Interface Vs Abstract Class
Interface Vs Abstract Class       There are three main differences between an interface and an abstract class: At the same time multiple interfaces can be implemented, but only
Class
there are two classes has been used except the main class in which the main function... is same to the class. But there are many difference between the method (function.... First class is another and second is the main class which name is Construct
main method
main method  hello, Can I make multiple main methods in the same class? If no then what will happen in compilation time?ADS_TO_REPLACE_1   hello No we can not make multiple main with in the same class program fails
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
class
class  Is a class a subclass of itself
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
class
is a class to represent a country in medal tally. It has an attribute of country... medals. In this class, you should also define constructors, and assessor, mutator methods. Task 2 MedalTally.java is a class to model a medal tally, containing
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
main method  Why is the java main method static
main method
main method  What is the argument type of a program's main() method
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() method
main() method  Can we define two main() methods having same parameter but with different return type in a program
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
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
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
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
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
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
Java 11 String lines function example to split it in lines
java.util.stream.Stream; public class StringLinesExample { public static void main(String...Java 11 String lines function - How to split String into lines in Java 11? In this tutorial we are going to explain use the use of new function which
Java 11 String lines function example to split it in lines
Java 11 String lines function - How to split String into lines in Java 11? In this tutorial we are going to explain use the use of new function which.... In this version of Java (JDK 11) String class introduces a new method
Is main method compulsory in Java?
Is main method compulsory in Java?  Hi, Can we have a executable class in Java without a main method? I am going to write simple Java program and there is main method. Is main method compulsory in Java? Thanks   Hi
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
isNaN function
isNaN function  What does isNaN function do
JPA Count Function
Class: Product.java Main Class: JPACountFunction.java Database Table...; } } Main Class: JPACountFunction.java /** *  */ package... JPA Count Function      
Class
we create a main class "Classtest" and also create a class "Example" which is outside of the main class and define a method "...;Example" and call display() method in main class. The class "Example"
function addValue
function addValue  i have question about the javascript the function addvalue script is working to add some name but is not save on the html so please resolve my problem what can i do for addvalue function will be to save
function addValue
function addValue  i have question about the javascript the function addvalue script is working to add some name but is not save on the html so please resolve my problem what can i do for addvalue function will be to save
function addValue
function addValue  i have question about the javascript the function addvalue script is working to add some name but is not save on the html so please resolve my problem what can i do for addvalue function will be to save
what is the correct format of charAt() function?
what is the correct format of charAt() function?   class prog...); } } class p3{ public static void main(String ar[]){ prog...:method charAt(int) location:class prog if(charAt(i
function method
function method  input Rs. 12000 Discount= 10%, 8% = Rs.(12000-1200) = Rs.(10800-864) = Rs. 9936

Ads