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

can rmi and corba based applications interact ?

1084


What does it mean that a class or member is final?

998


Can you change array size in java?

968


What is reverse function?

1140


How do you check if a number is a perfect square?

994


How do you add an element to an arraylist in java?

947


explain different ways of using thread? : Java thread

1017


What is the differences between c++ and java? Explain

1057


What is the difference between an object-oriented programming language and object-based programming language?

1012


What is the difference between integer parseint and integer valueof?

1006


Is java free for commercial?

923


What is the use of generics? When was it added to the Java development Kit?

1021


What’s the difference between applets and standalone program?

1051


Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.

1066


What are the methods used to implement for the key object in the hash map?

1046