Introduction
18 February 2019
Contents
• Brief history
• Features of Java
• Four Pillars of OO
• Java Program Constructs
Brief History of Java
Java SE
Duke
Java EE
Java ME
Java Cloud
Java Embedded
https://www.oracle.com/java/technologies/index.html
_____________
https://www.kettlemag.co.uk/the-history-of-the-java-programming-language/
https://twitter.com/jalalkiswani
Features of Java
https://www.youtube.com/watch?v=O5hShUO6wxs
1. Object-oriented
2. Simple
3. Secured
4. Platform-independent
5. Robust
6. Portable
7. Architectural Neutral
8. Dynamic
9. Interpreted
10. High Performance
11. Multithreaded
12. Distributed
https://www.javatpoint.com/features-of-java
The Four Pillars of OOP
https://www.vivaxsolutions.com/images/four-pillars.png
Abstraction Tangible IntangibleConceptual
CLASS OBJECT
Class Fish Nemo Identity
name
Color Orange and white
Instance Length 21.5
Name Name State
variables
Position Position
Swim() Swim()
Talk() Talk()
Methods MoveEyes() MoveEyes() Behavior
MoveLips() MoveLips()
Abstraction
https://www.guru99.com/java-oops-class-objects.html
Inheritance
A class cannot inherit from
multiple super classes, but
can implement multiple
interfaces.
Java also support hybrid
inheritance. https://www.tutorialspoint.com/java/java_inheritance.htm
http://www.pateanu.ca/yorku/ITEC2610/ch09/index.html
https://study.com/academy/lesson/inheritance-vs-polymorphism-in-java.html
https://www.jitendrazaa.com/blog/java/difference-between- https://codedbug.com/inheritance-in-java/
interfaceinheritance-abstract-class/
Polymorphism
http://editimage.club/newakc290930.html
Overriding
Same method name.
Same parameter,
different implementation
https://tutorial.eyehunts.com/java/java-polymorphism-
definition-type-example/
Overloading
https://javahungry.blogspot.com/2018/11/method-
overloading-in-java-with-examples.html
https://www.programcreek.com/2009/02/overriding-
and-overloading-in-java-with-examples/
https://programmingstack.com/java-
methods/9-java/49-java-method-
overloading.html
Encapsulation
https://www.geeksforgeeks.org/access-modifiers-java/
Java Program Constructs
class header method header or signature
body of method
body of class
comment
statement
semicolon
Java Escape Sequences
System.out.print("These are our top sellers:\n");
System.out.print("\tComputer games\n\tCoffee\n ");
System.out.println("\tAspirin");
These are our top seller:
Computer games
Coffee
Asprin
Which one?
https://howtodoinjava.com/java/basics/jdk-jre-jvm/
JDK
JRE
JVM
https://www.quora.com/What-is-the-difference-between-JVM-and-JDK
http://www.ntu.edu.sg/home/ehchua/programming/java/j1a_Introduction.html
Summary
• Java is a case-sensitive language.
• All Java programs must be stored in a file with a
.java file extension.
• Comments are ignored by the compiler.
• A .java file may contain many classes but may only
have one public class.
• If a .java file has a public class, the class must have
the same name as the file.
• Java applications must have a main method.
• For every left brace, or opening brace, there must be a
corresponding right brace, or closing brace.
• Statements are terminated with semicolons.
• Comments, class headers, method headers, and braces are
not considered Java statements.
Vocabulary
Review Questions
1. Why do we create computer programs?
2. Illustrate what happen to a java source code file
from the beginning until its execution.
3. What is the difference between a statement
and a comment?
4. Why must programs written in a high-level
language be translated into machine language
before they can be run?
5. What is pseudocode?
6. Java is portable. Explain.
7. What does compile means?
8. Compare C++ and Java program
development.
9. JVM stands for ___
10.Why does byte code make Java a
portable language?
Resources
• BlueJ http://bluej.org/
• Think Java (Allen Downey & Chris Mayfield)
• http://greenteapress.com/thinkjava6/thinkjava.pdf
• Online Java Compiler
• https://www.tutorialspoint.com/compile_java_o
nline.php
• https://www.jdoodle.com/online-java-compiler
• https://www.compilejava.net
• Online Java Tutorial
• https://docs.oracle.com/javase/tutorial/java/
• https://www.w3schools.in/java-tutorial/
• https://www.tutorialspoint.com/java/