| CPSC/DTSC 115L: Introduction to Computer Science | Fall 2026 |
To compile the source file HelloWorld.java, we then type:miyazaki@lab:~$ cd cpsc115 miyazaki@lab:~/cpsc115$ cd lab1
Once the Java compiler successfully complies HelloWorld.java, it generates a Java class file named HelloWorld.class in the same directory. This file contains object code to be executed on the Java Virtual Machine (JVM). To execute the object code, we type:miyazaki@lab:~/cpsc115/lab1$ javac HelloWorld.java
This should simply print:miyazaki@lab:~/cpsc115/lab1$ java HelloWorld
Now, modify your code so that it will print:Hello, World!
What happens when you change println to print? What does println do? Discuss with your partner.Hi there! How are you?
Your semantic error should not involve simply changing the text to print.Hi there! How are you?
You should include such a file header at the beginning of each source file you implement./** * This class prints greeting text. * * @author Takunari Miyazaki * @author Ewa Syta * @version 1.0, 09/09/2026 */
|
|
CPSC/DTSC 115L home page |
|
|