+ 3
what is difference between void bark() and public static void main( string...args)
brief description needed
5 Respuestas
+ 5
public static void main(String args []) is the main method .. ur program starts from here .. and void bark() is jst a method that u can use it in ur program if u want . it will only work if u envoke it ..
public = accesible to all
static = no need to create object .. main method is always static
void = returns nothing
String args= is main methods arguments
+ 1
Kalyan the public static void main (string...args) is the main method of your class. It covers everything.
void bark is specific to the class so is probably private. It is just a part of the class.
0
Thanks Bhushan, the void concept should be hard to understand at start. Still not so clear for me when can use the strings args but I have faith . Some day I can domain this.
- 2
public static void main is your main program
which doesnt return any value
only void () is a class which doesnt return any value
- 3
there is main class and other classes.
the main class covers all classes .