0% found this document useful (0 votes)
3 views2 pages

Java Hello World and Comments Example

The document contains 3 Java classes - Hello, HelloAgain, and Thisismyquest. Each class contains a main method that uses System.out.println or System.out.print statements to output text to the console, with the HelloAgain class demonstrating using multiple print statements and one println statement to output multiple lines of text.

Uploaded by

jirlieannlacasa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Java Hello World and Comments Example

The document contains 3 Java classes - Hello, HelloAgain, and Thisismyquest. Each class contains a main method that uses System.out.println or System.out.print statements to output text to the console, with the HelloAgain class demonstrating using multiple print statements and one println statement to output multiple lines of text.

Uploaded by

jirlieannlacasa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

package javaProgeam; public class Hello { public static void main(String[] args) { [Link]("Hello, world!

"); } }

package javaProgeam; public class HelloAgain { public static void main(String[] args) { [Link]("Hello,world!"); //Use double backslash to comment out [Link]("Java\tlanguage\tis\tawesome!\n"); [Link]("\tProgramming\t\tis\tfun!");//This is neat! } { // This program uses only ONE [Link]() [Link]("Hello, world!\n" + "Java\tlanguage\tis\tawesome!\n" + "\tProgramming\t\tis\tfun!"); } }

package javaProgeam; public class Thisismyquest { public static void main(String[]args) { [Link]("This is my quest!"); //Use double backslash to comment out [Link]("To\tfollow\tthe\t\tstar\n"); [Link]("\tNo\tmatter\thow\thopeless");// } }

Result:
This is my quest!To No matter follow the how hopeless star

You might also like