Presentation is loading. Please wait.

Presentation is loading. Please wait.

Applied Computing Technology Laboratory QuickStart Java Learning to Program in Java Dr. Tom Way October 21, 2005.

Similar presentations


Presentation on theme: "Applied Computing Technology Laboratory QuickStart Java Learning to Program in Java Dr. Tom Way October 21, 2005."— Presentation transcript:

1 Applied Computing Technology Laboratory QuickStart Java Learning to Program in Java Dr. Tom Way October 21, 2005

2 Applied Computing Technology Laboratory 2 The Java Programming Language Developed in 1996 Created by Patrick Naughton, James Gosling and Mike Sheridan (and others) at Sun Microsystems Original called the “Green Project” Uses Object-Oriented paradigm Good for general purpose applications, web apps, databases, etc.

3 Applied Computing Technology Laboratory 3 Java Advantages Platform independence – “write once, run anywhere” Fast prototyping of user interfaces Excellent documentation Great for teaching and learning Increasing in popularity Now used widely in industry Automatic garbage collection

4 Applied Computing Technology Laboratory 4 Java Disadvantages Compile to Java byte code, not native Runs on “virtual machine,” so can be slower than native machine Doesn’t have true multiple inheritance (but can get through multiple interfaces) Some simple things are harder – keyboard input, primitive types vs. Objects

5 Applied Computing Technology Laboratory 5 Java Specification Third edition available on Sun web site http://java.sun.com http://java.sun.com Explains: Grammar Lexical structure Types, values, variables Type conversions and promotions Packages, classes, interfaces, inheritance Arrays, exceptions, execution, blocks, statements, expressions, assignments, threads, locks

6 Applied Computing Technology Laboratory 6 Java Grammar Available on Sun web site http://java.sun.com/docs/books/jls/third_edition/html/syntax.html#18.1 http://java.sun.com/docs/books/jls/third_edition/html/syntax.html#18.1 Example: Type: Identifier [TypeArguments]{. Identifier [TypeArguments]} {[]} BasicType TypeArguments: TypeArgument: Type ? [( extends | super ) Type] Identifier: IDENTIFIER BasicType: byte | short | char | int | long | float | double | boolean

7 Applied Computing Technology Laboratory 7 Identifier Identifier: IdentifierChars but not a Keyword or BooleanLiteral or NullLiteral IdentifierChars: JavaLetter IdentifierChars JavaLetterOrDigit JavaLetter: any Unicode character that is a Java letter JavaLetterOrDigit: any Unicode character that is a Java letter-or- digit

8 Applied Computing Technology Laboratory 8 Step 1: Getting Started Download & install JDK from: http://java.sun.com/j2se/1.5.0/download.jsp http://java.sun.com/j2se/1.5.0/download.jsp Double-click on file to run installer Follow your nose Check online installation instructions for helpful tips

9 Applied Computing Technology Laboratory 9 Step 2: Eclipse Download & install Eclipse from: http://eclipse.org/downloads http://eclipse.org/downloads Unzip to a directory (e.g., C:\eclipse) Create desktop shortcut, if you like Right-click on eclipse.exe Send to -> Desktop (create shortcut)

10 Applied Computing Technology Laboratory 10 Step 3: Write a simple program File->New->Project Select “Java Project” Name project “Hello World” Select File->New->Class Name the class “HelloWorld” (no spaces) Check “public static void main()” box Add one line in the main() method: System.out.println(“Hello world!”);

11 Applied Computing Technology Laboratory 11 Step 4: Run the program Right-click on HelloWorld.java Select Run As->Java Application Watch console at bottom for output Congratulations!

12 Applied Computing Technology Laboratory 12 Learning more about Java Visit the QuickStart Languages web site http://actlab.csc.villanova.edu/quickstart http://actlab.csc.villanova.edu/quickstart View or download the Java API: http://java.sun.com/j2se/1.5.0/docs/api/index.html http://java.sun.com/j2se/1.5.0/docs/api/index.html Read the Java Developers Almanac http://javaalmanac.com/ http://javaalmanac.com/ Google search for: java program examples


Download ppt "Applied Computing Technology Laboratory QuickStart Java Learning to Program in Java Dr. Tom Way October 21, 2005."

Similar presentations


Ads by Google