CC2203-les00java0-for-Viewing-1011s2

CC2203-les00java0-for-Viewing-1011s2 - Lesson 0: Java 0...

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

View Full Document Right Arrow Icon
0-1/31 Lesson 0: Java 0 – Java Basics, Data Types and Operators After completing this lesson, you should be able to do the following: Identify the key elements of Java Describe the Java Virtual Machine (JVM) Identify the key components of the J2SE Java Development Kit (known as JDK or SDK) Identify and describe Java packages Identify the basic constructs of a Java program Compile a .java file Run a Java application Use the CLASSPATH , its compile, and run-time importance
Background image of page 1

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

View Full DocumentRight Arrow Icon
0-2/31 Describe Java primitive data types and variables Declare and initialize primitive variables Use Java operators to manipulate primitive variables
Background image of page 2
0-3/31 What Is Java? Is a platform-independent and an object-oriented language Was originally designed by Sun for consumer electronics Contains a class library Uses a virtual machine for program execution
Background image of page 3

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

View Full DocumentRight Arrow Icon
0-4/31 Platform Independence Java source code is stored as text in a .java file. The .java file is compiled into .class files. A .class file contains Java bytecodes (instructions). The bytecodes are interpreted at run time. The Java .class file is the executable code. Compile Movie.java JVM Running program Movie.class (javac) (java)
Background image of page 4
0-5/31 How Does the JVM Work? The class loader loads all required classes. Uses a CLASSPATH setting to locate class files The JVM Verifier checks for illegal bytecodes and executes legal bytecodes. The Memory Manager releases memory back to the OS. Garbage collection
Background image of page 5

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

View Full DocumentRight Arrow Icon
0-6/31 The Java Software Development Kit The Sun Java J2SE (known as JDK and SDK) includes: Compiler (javac) Core class library classes.zip (in JDK 1.1) rt.jar (in JDK 1.2 or higher) Bytecode interpreter: the JVM (java) Others such as Debugger ( jdb ), Documentation generator (javadoc), Applet viewer (appletviewer) and Java Archive utility ( jar )
Background image of page 6
0-7/31 Establishing Naming Conventions Naming conventions include: Filenames Customer.java , RentalItem.java Class names Customer , RentalItem , InventoryItem Method names: getCustomerName( ) , setRentalItemPrice( ) Package names java.awt , java.io Variables: customerName , customerCreditLimit Constants: MIN_WIDTH , MAX_NUMBER_OF_ITEMS
Background image of page 7

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

View Full DocumentRight Arrow Icon
0-8/31 Rental Class Example public class Customer {
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/18/2011 for the course COMP 3868 taught by Professor Keithchan during the Summer '97 term at Hong Kong Polytechnic University.

Page1 / 31

CC2203-les00java0-for-Viewing-1011s2 - Lesson 0: Java 0...

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

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