Академический Документы
Профессиональный Документы
Культура Документы
Introduction to Java Java Features Program Structure Java Tokens Java Statements Implementing a Java Program Java Virtual Machine
Overview of Java
Learning outcomes
At the end of this lecture you should be able to: Identify the Java features. Familiarize with the basic Java Program Structure and syntax. Identify different types of Java Tokens and Java Statements.
CT038-3-2 OODJ
Overview of Java
Introduction to Java
Java is a Object Oriented programming language developed by Sun Microsystems.
CT038-3-2 OODJ
Overview of Java
Java Features
Compiled & Interpreted Platform Independent & Portable Object Oriented Robust & Secure Distributed Multithreaded
CT038-3-2 OODJ
Overview of Java
Program Structure
Example A simple Java Program class SampleOne { public static void main(String args[ ]) { System.out.println(Hello Java); } }
CT038-3-2 OODJ Overview of Java
Class declaration Opening & Closing Brace The main line The output line
CT038-3-2 OODJ
Overview of Java
Java Tokens
Smallest individual units in a program are known as tokens. Basically, a Java program is a collection of tokens, comments and white spaces. Includes 5 types of tokens : Reserved keywords Identifiers Literals Operators Separators
CT038-3-2 OODJ Overview of Java
Java Statements
A statement is an executable combination of tokens ending with a semicolon mark. Some examples:
Statement Expression Selection Iteration Jump
CT038-3-2 OODJ
Example Assignment, increment if, if-else, switch while, do, for break, continue, return
Overview of Java
CT038-3-2 OODJ
Overview of Java
CT038-3-2 OODJ
Overview of Java
Java Program
Java Compiler
JVM
My program
Source code
Bytecode
CT038-3-2 OODJ
Overview of Java
Summary
Java is a Object Oriented Language. Classes are fundamental building blocks of Java programs. Every Java application contains a class with a main method.
CT038-3-2 OODJ
Overview of Java