Yahoo Interview Question for Software Engineer / Developers


Country: United States
Interview Type: Phone Interview




Comment hidden because of low score. Click to expand.
6
of 6 vote

public : its public you can call it from anywhere
static : without creating object you can call the method, so JVM can call this
void : return type of main is void means main is not returning anything to JVM
main : it is the method name

- Kapil.smart1709 August 16, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public indicates that the main() method can be called by any object.
static indicates that the main() method is a class method.
void indicates that the main() method has no return value.

- Anonymous December 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

This answer is a little incomplete. I'd like to see some mention of the String[] argument with respect to command line arguments.

- eugene.yarovoi December 11, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

public indicates ,we can call it from anywhere.void indicates main function does not return anything and static means JVM will automatically call main function no need to create reference of a class to call main method

- Bindu December 13, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

main() is entry point in a program execution

- Anonymous December 22, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public is necessary so that JVM could call the method from outside the package.
static is necessary so that JVM would not require any object to call this method.

- Aashish July 24, 2012 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More