CreatingAsimpleJavaApplication

CreatingAsimpleJavaApplication - • then it looks for the...

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

View Full Document Right Arrow Icon
COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 1 Creating a simple Java application: Write Source Code (*.java) 1 Byte Code Compile Source Code using a compiler( javac ) 2 Run the bytecode in a JVM ( java ) 3 1. Create a file, e.g. HelloWorld.java 2. Compile: javac HelloWorld.java 1. Run: java HelloWorld
Background image of page 1

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

View Full DocumentRight Arrow Icon
COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 2 Code structure in Java
Background image of page 2
COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 3 When the JVM starts running, it looks for the class you give it at the command line
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • then it looks for the main method inside that class • main method is executed until the end of main is reached main method looks like: public static void main(String args) { …… } COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 4 What will happen when HelloWorld class runs: java HelloWorld public class HelloWorld { public static void main(String args) { System.out.println(“Hello”); System.out.print(“World”); System.out.println(“Example”); } } Output: Hello WorldExampl e...
View Full Document

This note was uploaded on 12/12/2010 for the course COE 318 taught by Professor Ken during the Spring '08 term at Ryerson.

Page1 / 4

CreatingAsimpleJavaApplication - • then it looks for the...

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

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