What if the main method is declared as private core java interview questions and answers
1,384 views · Published 15 September 2012 · 2:24 · Indexed 5 October 2026
Channel: Interview DOT · 2012 · Science & Technology
Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications. http://www.interviewdot.com
Welcome to www.InterviewDot.com How to prepare for Java interview Questions :
Core Java Interview Questions and Answers :
What if the main() method is declared as private?
The program compiles properly but at runtime it will give "main() method not public." message.
Public class mainDemo {
Private static void main(){
/// will it compile ? -- yes it compiles & but you cant make it run ??
}
}
For more Java Interview questions and answers - logon to www.InterviewDot.com - India's Top Interview Guide.
More from this channel
-
3:19
java interview best books
-
5:51
Top 4 Job Interview Tips How to prepare for Job interview
-
2:42
what are different access modifiers core java interview questions and answers
-
2:08
Interview dos and donts how to prepare for interview
-
0:43
Top Core Java Interview questions and answers 8
-
1:00
Top Core Java Interview questions and answers 2
-
1:04
Top Core Java Interview Question and Answer 9
-
0:54
Top Core Java Interview Question and Answer Job Interview 15