QUICK INTRO TO JAVA

QUICK INTRO TO JAVA - QUICK INTRO TO JAVA STEP 1: TYPE YOUR...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
STEP 1: TYPE YOUR PROGRAM First, use pico or vi (or any text editor) to create a file named Prog1.java (See the the lecture notes, or the "Lectures -- Intro to Vi" link on this website, for instructions on how to create a text file using the vi text editor.) Inside your Prog1.java file, put the following text: public class Prog1 { public static void main(String args[]) { System.out.println("Hello"); } } NOTE: Be careful, some of those are braces "{ }" and some of those are parentheses "( )". It might be hard to tell them apart, on a Web page. So look carefully, if you're not sure. STEP 2: COMPILE YOUR PROGRAM After creating and saving the file Prog1.java, and after exiting your text editor, then at the rohan prompt type javac Prog1.java If your program contains no syntax errors, then the Java compiler (named "javac") will compile your program into Java bytecode and store the Java bytecode in a new file named Prog1.class (which will automatically appear in your directory). Java bytecode is the gibberish-looking, machine-language version of your program,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/17/2011 for the course CS 107 taught by Professor Ivanbajic during the Fall '08 term at San Diego.

Page1 / 2

QUICK INTRO TO JAVA - QUICK INTRO TO JAVA STEP 1: TYPE YOUR...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online