Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What happens when a main method is declared as private?

Answer Posted / kundan

when u will declare main method is private
it will successfully compile and Run
and result will publish,

class A
{
int x=7;
void show(){
System.out.println(x);
}
}
class Test
{
private static void main(String args[])
{
A a = new A();
a.show();
}
}

out put:-
Main method not public

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Outline the major features of java.

1031


Is there any way to skip finally block of exception even if some exception occurs in the exception block?

999


What is java Applet?

1033


What advantage do java's layout managers provide over traditional windowing systems?

908


Difference between character constant and string constant in java ?

959


How to print nodes of a Binary tree?

2198


What does serializing data mean?

896


What are the major advantages of internal iteration over external iteration?

984


Why is it called a string?

940


What are the types of relation?

992


What is extension method in java?

984


Explain the significance of listiterator.

1022


What value is a variable of the string type automatically initialized?

1048


Why main method is called first in java?

942


What is a vararg?

959