nerdexam
Oracle

1Z0-803 · Question #269

Given: public class App { // Insert code here System.out.print("Welcome to the world of Java"); } } Which two code fragments, when inserted independently at line // Insert code here, enable the progra

The correct answer is A. static public void main (String [] args) { D. public static void main (String [] args) {. Not B: No main class found. Not C: Main method not found not E: Main method is not static.

Java Basics

Question

Given:

public class App { // Insert code here System.out.print("Welcome to the world of Java"); } } Which two code fragments, when inserted independently at line // Insert code here, enable the program to execute and print the welcome message on the screen?

Options

  • Astatic public void main (String [] args) {
  • Bstatic void main (String [] args) {
  • Cpublic static void Main (String [] args) {
  • Dpublic static void main (String [] args) {
  • Epublic void main (String [] args) {

How the community answered

(22 responses)
  • A
    95% (21)
  • B
    5% (1)

Explanation

Not B: No main class found. Not C: Main method not found not E: Main method is not static.

Topics

#Main method#Method signatures#Java entry point

Community Discussion

No community discussion yet for this question.

Full 1Z0-803 Practice