CSC1016S Lecture 02 - 25/07/2023
Topic: Introduction to Java
Course: CSC1016S
Date: 25/07/2023
Professor/Speaker: Aslam Safla
INTRODUCTION TO JAVA
Java is an Object-Oriented Program (OOP)
Created by James Gosling (in 1991)
Released by Sun Microsystems (in 1996)
A type of Interpreted language (executes one line at a time)
Functions are called methods in Java
Java is a compiled language
A regular Java program is a class with the main method
JAVA CODING STEPS: Java code/java byte code/machine language/execute
Java can be considered both a compiled and an interpreted language because
its source code is first compiled into a binary byte-code. This byte-code runs
on the Java Virtual Machine (JVM), which is usually a software-based
interpreter.
Why Java byte code?
Makes Java portable
Allows program to run across various machines
Difference between compiled and interpreted language:
A compiled language is converted into machine code so that the processor
can execute it. An interpreted language is a language in which the
implementations execute instructions directly(line by line) without
earlier compiling a program into machine language. The compiled
programs run faster .th
an interpreted programs.
TYPICAL HELLOWORD PROGRAM
1 public class FirstProgram //class name
2{
3 public static void main ( String [ ] args) //main method
4 {
5 System.out.println("Hello world");
6 //Semi-colons at the end of every statement
7 }
Topic: Introduction to Java
Course: CSC1016S
Date: 25/07/2023
Professor/Speaker: Aslam Safla
INTRODUCTION TO JAVA
Java is an Object-Oriented Program (OOP)
Created by James Gosling (in 1991)
Released by Sun Microsystems (in 1996)
A type of Interpreted language (executes one line at a time)
Functions are called methods in Java
Java is a compiled language
A regular Java program is a class with the main method
JAVA CODING STEPS: Java code/java byte code/machine language/execute
Java can be considered both a compiled and an interpreted language because
its source code is first compiled into a binary byte-code. This byte-code runs
on the Java Virtual Machine (JVM), which is usually a software-based
interpreter.
Why Java byte code?
Makes Java portable
Allows program to run across various machines
Difference between compiled and interpreted language:
A compiled language is converted into machine code so that the processor
can execute it. An interpreted language is a language in which the
implementations execute instructions directly(line by line) without
earlier compiling a program into machine language. The compiled
programs run faster .th
an interpreted programs.
TYPICAL HELLOWORD PROGRAM
1 public class FirstProgram //class name
2{
3 public static void main ( String [ ] args) //main method
4 {
5 System.out.println("Hello world");
6 //Semi-colons at the end of every statement
7 }