Please enable JavaScript to use CodeHS

Chapter 1

Primitive Types

1.2 Why programming? Why Java?

Environment Set Up

Writing Hello World

Hello World

Println vs Print

Printing Multiple Lines

Check Your Understanding

  1. Invalid Answer

Exercise: ASCII Art

Vocabulary

Term Definition
String String is a Java type that represents a string of characters (text)
String Literals A sequence of characters enclosed in double quotations “ “.
Java Main Skeleton Includes the class and main method arguments. Must include both in order to run successfully.
public static void main(String args[]) Main method. Code to be run must be placed within the main method.
public class MyProgram Class. The name of MyProgram must match the name of the file.
System.out.print Displays output on the computer monitor.
System.out.println Displays output on the computer monitor and moves cursor to next line.