What happens when a main method is declared as private?

Answers were Sorted based on User's Feedback



What happens when a main method is declared as private?..

Answer / varsha vilas kalebag

IF MAIN METHOD IS DECLARED AS PRIVATE ,THEN WE CAN NOT
ACESSES THE PRVIATE MEMBERS IN ANOTHER CLASS

Is This Answer Correct ?    5 Yes 43 No

What happens when a main method is declared as private?..

Answer / vani

Nothing Happen.
Code compiles properly and executes properly.

Is This Answer Correct ?    5 Yes 76 No

Post New Answer

More Core Java Interview Questions

What is Generic in java? Where can we write Generic ( class or method or objects or etc...)? with simple example? Thanks, Bose.

2 Answers   Infosys, Tech Mahindra,


How can we get one Interface methods whit out using implementation of interface

1 Answers   Oracle,


What are the advantages of exception handling?

1 Answers  


Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).

1 Answers  


why are wait(), notify() and notifyall() methods defined in the object class? : Java thread

1 Answers  


What is subsequence of a string?

1 Answers  


Can you extend main method in java?

1 Answers  


What is == in java?

1 Answers  


What is the size of int?

1 Answers  


Explain java coding standards for constants?

1 Answers  


What is 3-tier model?

3 Answers   Wipro,


What is multithreading in java?

1 Answers  


Categories