CSE 110 Lecture Notes - Lecture 1: Javac, Text Editor
Document Summary
Example contains 1 or more methods contains program statements public class helloworld public static void main (string[] args) - method header (strings[] args) = arguments. *every java application has exactly one main" method. *void is a return type - no return. A good practice to include comments to describe your program. Comments are not executed when you run a program. Save the program as helloworld. java: compile the program, run the program. You can also use a simple text editor such as notepad to write your source code. Once saved as helloworld. java, you can use a console window to: compile the program by typing javac helloworld. java, run the program by typing java helloworld println and print. *println method prints a string or a number and then starts a new line. Logic errors (such as trying to divide by zero, which causes a program to terminate abnormally. Each java program should have at least one class.