in Education by
Which of these access specifiers must be used for main() method? (a) private (b) public (c) protected (d) none of the mentioned I had been asked this question at a job interview. I want to ask this question from Access Control topic in division Classes and Methods of Java Select the correct answer from above options Java questions and answers, Java questions pdf, Java question bank, Java questions and answers pdf, mcq on Java pdf, Java questions and solutions, Java mcq Test , Interview Java questions, Java Questions for Interview, Java MCQ (Multiple Choice Questions),Core Java Questions, Core Java MCQ,core java interview questions for experiencedcore java interview questions for 3 years experience,java programming questions,core java interview questions for freshers,java interview questions and answers for freshers, java programming questions and answers pdf, java interview questions for beginners

1 Answer

0 votes
by
 
Best answer
The correct choice is (b) public Easiest explanation: main() method must be specified public as it called by Java run time system, outside of the program. If no access specifier is used then by default member is public within its own package & cannot be accessed by Java run time system.

Related questions

0 votes
    Which of these transfer protocol must be used so that URL can be accessed by URLConnection class object? (a ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these class must be used to send a datagram packets over a connection? (a) InetAdress (b) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these methods must be made static? (a) main() (b) delete() (c) run() (d) finalize( ... , java programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these method of String class can be used to test to strings for equality? (a) isequal() ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these data type can be used for a method having a return statement in it? (a) void (b ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these is used as a default for a member of a class if no access specifier is used for it ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of this keyword must be used to inherit a class? (a) super (b) this (c) extent (d) ... java programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these keywords can be used to prevent Method overriding? (a) static (b) constant (c) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these method of Double wrapper can be used to check whether a given value is infinite or not ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these method can be used to increase the capacity of ArrayList object manually? (a) Capacity() ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is used to access a member of class before object of that class is created? (a) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these method of class String is used to compare two String objects for their equality? (a) ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these package is used for remote method invocation? (a) java.applet (b) java.rmi (c) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of the below is invalid identifier with the main method? (a) public (b) static (c) private ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these method of String class is used to obtain character at specified index? (a) char() ( ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
...