Java Programming: Hello World Analysis
16 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

A Java program is a ______.

class

Every class has a ______ and the convention is that a class name starts with a capital letter.

name

The simple programs that we are starting with will only contain one ______.

class

Every opening curly bracket must have an associated ______ bracket.

<p>closing</p> Signup and view all the answers

Java applications must have a method called ______, which is where execution of the program starts.

<p>main</p> Signup and view all the answers

A method contains a collection of programming instructions that describe how to carry out a particular ______.

<p>task</p> Signup and view all the answers

MS-DOS Analysis of “Hello World” program The rest of this line is beyond your ______ as of yet;

<p>understanding</p> Signup and view all the answers

A program starts with the first instruction of main, then obeys each instruction in ______

<p>sequence</p> Signup and view all the answers

The program terminates when it has finished obeying the final instruction of ______

<p>main</p> Signup and view all the answers

This now brings us to the important part the line of code that represent our instruction display “Hello World” System.out.print(“Hello World”); To get anything printed to the screen we use ______ and put whatever we want to be displayed in the brackets

<p>System.out.print</p> Signup and view all the answers

A sequence of characters enclosed in double quotes as above is known as a ______

<p>String</p> Signup and view all the answers

We can also use another print statement which is println println is short for print line and the effect of using this statement compared to print is to start a new line after displaying whatever is in the ______

<p>brackets</p> Signup and view all the answers

Note the semi-colon (;) at the end of the print statement We must include a semi-colon at the end of every instruction we write in Java to indicate that it is a ______

<p>statement</p> Signup and view all the answers

Compile time error (syntax error) – Violation of the programming language rules – Detected by the compiler – ______

<p>System.ou.println</p> Signup and view all the answers

Errors Run time error (logic error) – Causes program to perform action programmer did not intend – System.out.println("Hello Word"); Program will still compile and run but will print Hello Word instead of ______

<p>Hello World</p> Signup and view all the answers

Comments are lines written by the programmer that convey some type of information concerning the code such as filenames, titles or explanations of what the code is ______

<p>doing</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser