C01.1Intro To Java

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

ITPF 01– Object Oriented Programming 1

C01.1 Introduction to Object Oriented


Programming

Melgine M. Bauat, MSIT


Instructor ITPF 01
What is OOP?

OOP stands for Object-Oriented Programming.

Procedural programming is about writing procedures or


methods that perform operations on the data, while object-
oriented programming is about creating objects that contain both
data and methods.

ITPF 01
What is OOP?

Object-oriented programming has several advantages over


procedural programming:

• OOP is faster and easier to execute


• OOP provides a clear structure for the programs
• OOP helps to keep the Java code DRY "Don't Repeat Yourself",
and makes the code easier to maintain, modify and debug
• OOP makes it possible to create full reusable applications with
less code and shorter development time

We will be using Java Programming Language in our


OOP Subject
ITPF 01
What is Java?

Java is a programming language and computing platform first


released by Sun Microsystems in 1995. It has evolved from
humble beginnings to power a large share of today’s digital
world, by providing the reliable platform upon which many
services and applications are built. New, innovative products
and digital services designed for the future continue to rely on
Java, as well.

ITPF 01
What is Java?

Java applications are called WORA (Write Once Run


Anywhere). This means a programmer can develop Java
code on one system and can expect it to run on any other
Java-enabled system without any adjustment.

JVM(Java Virtual Machine) acts as a run-time engine to run


Java applications. JVM is the one that actually calls the main
method present in Java code. JVM is a part of the JRE(Java
Runtime Environment). ITPF 01
What is Java?

Java is platform independent: the same program can run on


any correctly implemented Java system
Java is object-oriented:
Structured in terms of classes, which group data with
operations on that data
Can construct new classes by extending existing ones
Java designed as
A core language plus
A rich collection of commonly available packages
Java can be embedded in Web pages

ITPF 01
Characteristics of Java
• Java is simple
• Java is object-oriented
• Java is distributed
• Java is interpreted
• Java is robust
• Java is secure
• Java is architecture-neutral
• Java is portable
• Java’s performance
• Java is multithreaded
• Java is dynamic

ITPF 01
What is Class and Object?

Classes and objects are the two main aspects of object-oriented


programming.

Example:
CLASS OBJECTS
Fruit Banana
Apple
Mango

Feline Cat
Leopard
Jaguar
Tiger
ITPF 01
Is Java free to download?

Yes, Java is free to download for personal use.


Java is also free for development: developers can find
all the development kits and other useful tools at 
https://www.oracle.com/javadownload/.

ITPF 01
What is/are the requirements(s) of Java Programming?

You can compile Java Code using JDK.

The JDK is a development environment for building


applications, applets, and components using the
Java programming language.

Download JDK at
https://www.oracle.com/java/technologies/downloads/#jd
k18-windows
ITPF 01
What is/are the requirements(s) of Java Programming?

ITPF 01
What is/are the requirements(s) of Java Programming?

You can compile Java Code using JDK.

The JDK is a development environment for building


applications, applets, and components using the
Java programming language.

Download JDK at
https://www.oracle.com/java/technologies/downloads/#jd
k18-windows
ITPF 01
Java JDK Installation in your machine
Download Appropriate Java Installer for your machine (32bit or
64bit)

https://www.oracle.com/java/technologies/downloads/#jdk17-windows

ITPF01: Object- Oriented Programming 1


Java JDK Installation in your machine

Install to C:\Program Files\Java\jdk\

ITPF01: Object- Oriented Programming 1


Configure Java Path Environment for Windows

3
4

5
1
6
2
7
8

10 11
ITPF01: Object- Oriented Programming 1
Configure Java ClassPath Environment for Windows

1
5

2
6 7

8 Restart PC/Laptop

ITPF01: Object- Oriented Programming 1


Notepad++ Installation in your machine
Download Appropriate Notepad++ Installer for your machine
(32bit or 64bit)

https://notepad-plus-plus.org/downloads/v8.1.9.3/

ITPF01: Object- Oriented Programming 1


Java Program

ITPF01: Object- Oriented Programming 1


Coding, Compiling, and Executing Java Program

This is your readable code (MyJava.java) written in


text editor [Notepad++]

Your Java Code (MyJava.java) will be compiled by


Java Compiler (javac)

The compiled output will be MyJava.class

The compiled output (MyJava.class) will be executed

ITPF01: Object- Oriented Programming 1


Writing Java Program
1. Open Notepad++ and write
Java Code
2. Create a Java Directory or
Folder in your Drive C:
C:\Java
3. Save your Java Code according
to your ClassName [must be exact
Case. Remember that Java is CaSE
sEnSitiVE] In this example
ClassName = HelloJava
FileName = HelloJava.java

ITPF01: Object- Oriented Programming 1


Compiling and Executing Java Program

3. type javac and the java code File


1. Search and open CMD [Command Prompt]

4. Browse your folder containing java code. There must


be a “.class” file [HelloJava.class]

2. Go to C:/Java by typing these command

5. Execute the compiled java class

ITPF01: Object- Oriented Programming 1


Seatwork #1
Create a simple Java Application that will
print your Full Name and age. Screenshot
the procedure you underwent and explain
each part of the procedure (Writing,
Compiling, and Executing Java
Application)

ITPF01: Object- Oriented Programming 1


ITPF 01– Object Oriented Programming 1

Thank you for listening!

ITPF 01

You might also like