0% found this document useful (0 votes)
9 views24 pages

JAVA-ch1

Uploaded by

fitsumhlina777
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views24 pages

JAVA-ch1

Uploaded by

fitsumhlina777
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Object Oriented Programming

Chapter One: Introduction to Object-Oriented


Programming

Abey B. (MSc.)

Debre Berhan University


Faculty of Computing
Department of Information System

May 25, 2023

Chapter One Introduction to Object-Oriented Programming May 25, 2023 1 / 24


Outline

Basic Concepts
▶ Introduction to programming
▶ Basics of programming
▶ Overview of OO principles
▶ Overview of Java Programming
▶ Types of Java Program
▶ Java Application

Chapter One Introduction to Object-Oriented Programming May 25, 2023 2 / 24


Introduction to programming

What is Computer?
Computer is an electronic device that accepts data, performs
computations, and makes logical decisions according to instructions
that have been given to it;
▶ Then produces meaningful information in a form that is useful to the
user.
A computer is an electronic device that manipulates information, or
data.
It has the ability to store, retrieve, and process data.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 3 / 24


Introduction to programming

Definition
Computer Programs, Software Programs, or just Programs is
instructions that tells the computer what to do.
Computer programming is the process that professionals use to write
code that instructs how a computer, application or software program
performs.
Writing computer programs means writing instructions
▶ That will make the computer follow and run a program based on
those instructions.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 4 / 24


Introduction to programming

Computer programs (also know as source code) is often written by


professionals known as Computer Programmers (simply
programmers).
Source code is written in one of programming languages.
A programming language is an artificial language that can be
used to control the behavior of a machine, particularly a computer.
Programming languages, like natural language (such as Amharic),
are defined by Syntax and semantic rules
▶ Syntax: is the set of predefined rules, processes, and protocols that
everyone should follow, if they want an error-free code.
▶ Semantic:is the meaning of the expressions, statements, and
program units.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 5 / 24


Introduction to programming

Programming languages can be divided in to two major categories:

Chapter One Introduction to Object-Oriented Programming May 25, 2023 6 / 24


Programming languages categories

Low-level Languages
Computers only understand one language and that is binary language
or the language of 1s and 0s.
All the instructions were given in binary form.
Although the computer easily understood these programs,
▶ It proved too difficult for a normal human being to remember all
the instructions in the form of 0s and 1s.
▶ Low-level Languages is a type of language, which is machine
friendly.
▶ Two common types of low-level programming languages are assembly
language and machine language.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 7 / 24


Programming languages categories

Low-level Languages Type


Machine-level language
▶ The Machine-level language is a language that consists of a set of
instructions that are in the binary form 0 or 1.
⋆ So,the instructions given to the computer can be only in binary
codes
▶ If we write a program in one computer will no longer be valid in
another computer.
▶ It does not require any translator as the machine code is directly
executed by the computer.
▶ It is a first-generation programming language.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 8 / 24


Programming languages categories

Low-level Languages Type


Assembly language
▶ Assembly language correspondences symbolic instructions and
executable machine codes
▶ Since assembly language instructions are written in English words like
mov, add, sub, so it is easier to write and understand.
▶ As we know that computers can only understand the machine-level
instructions
⋆ So we require a translator that converts the assembly code into
machine code.
▶ The translator used for translating the code is known as an assembler.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 9 / 24


Programming languages categories

High-level languages
A high-level language is any programming language that enables
development of a program in a much more user-friendly
programming context
High-level language is generally independent of the computer’s
hardware architecture.
High-level language does not require addressing hardware
constraints when developing a program.
High-level languages also require translation to machine language
before execution.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 10 / 24


Programming languages categories

High-level languages
This translation is accomplished by either a compiler or an interpreter.

▶ Compiler
⋆ Compilers translate the entire source code program before execution.
▶ Interpreters
⋆ Interpreters translate source code programs one line at a time.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 11 / 24


Introduction to Java

What is Java?
Java is a programming language.
java is a high level, robust, object-oriented and secure
programming language.
Java is a powerful general-purpose programming language.
▶ It is used to develop desktop and mobile applications, big data
processing, and so on.
Java is one of the most popular programming languages.
▶ Because,according to Oracle, Java runs on 3 billion devices
worldwide

Chapter One Introduction to Object-Oriented Programming May 25, 2023 12 / 24


Introduction to Java

What is Java?
The Java language is object-oriented and programs written in
Java are portable
▶ That is, they can be run on many different platforms
Java is different from other programming languages because a
Java program is compiled and interpreted
▶ In many other languages, the program is either compiled or
interpreted.
The Java compiler translates the program into an intermediate
language called Java bytecodes.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 13 / 24


Introduction to Java

a java program is compiled, java bytecode is generated.


java bytecode is the machine code in the form of a .class file.
Java bytecodes are platform-independent
▶ This means they can be run on different operating systems

Chapter One Introduction to Object-Oriented Programming May 25, 2023 14 / 24


Introduction to Java

bytecode

Chapter One Introduction to Object-Oriented Programming May 25, 2023 15 / 24


Introduction to Java

What is Java?
Compilation only needs to happen one time, whereas
interpretation happens every time the program is executed.
The source code for a Java program is saved to one or more .java
files.
▶ The compiler generates a .class file for each .java file
A .java file can be opened and viewed in any text editor
▶ But a .class file is bytecode so it cannot be viewed in the same way

Chapter One Introduction to Object-Oriented Programming May 25, 2023 16 / 24


Introduction to Java

Why Java is Popular?


High quality learning resources
▶ So many learning resources are available for new programmers.
Inbuilt functions and libraries
▶ When using Java, developers don’t need to write every new function
from scratch.
▶ Java provides a rich ecosystem of in-built functions and libraries to
develop a range of applications.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 17 / 24


Introduction to Java

Why Java is Popular?


Active community support
▶ Java has many active users and a community that can support
developers when they face coding challenges.
▶ The Java platform software is also maintained and updated regularly.
High-quality development tools
▶ Java offers various tools to support automated editing, debugging,
testing, deployment, and change management.
▶ These tools make Java programming time and cost-efficient.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 18 / 24


Introduction to Java

Why Java is Popular?


Platform Independent
▶ Java code can run on any underlying platform like Windows, Linux,
or Android without rewriting.
▶ This makes it especially powerful in today’s environment, where we
want to run applications on multiple devices.
Security
▶ Users can download untrusted Java code over a network and run it in a
secure environment in which it cannot do any harm.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 19 / 24


Introduction to Java

Types of Java Applications


Standalone Application
▶ Standalone applications are also known as desktop applications or
window-based applications.

Web Application
▶ An application that runs on the server side and creates a dynamic
page is called a web application.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 20 / 24


Introduction to Java

Types of Java Applications


Enterprise Application
▶ An application that is distributed in nature, such as banking
applications, etc. is called an enterprise application.
Mobile Application
▶ An application which is created for mobile devices is called a mobile
application.
▶ Currently, Android are used for creating mobile applications.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 21 / 24


Introduction to Java

Java programming language used for


Some common uses of Java include:
▶ Game Development
⋆ Many popular mobile, computer, and video games are built in Java.
⋆ Even modern games that integrate advanced technology like machine
learning or virtual reality are built with Java technology.
▶ Cloud computing
⋆ Java is often referred to as WORA – Write Once and Run Anywhere,
making it perfect for decentralized cloud-based applications.
▶ Big Data
⋆ Java is used for data processing engines that can work with complex
data sets and massive amounts of real-time data.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 22 / 24


Introduction to Java

Java programming language used for


Some common uses of Java include:
▶ Artificial Intelligence
⋆ Java is powerhouse of machine learning libraries.
⋆ Its stability and speed make it perfect for artificial intelligence
application development like natural language processing and deep
learning.
▶ Internet of Things
⋆ Java has been used to program sensors and hardware in edge devices
that can connect independently to the internet.

Chapter One Introduction to Object-Oriented Programming May 25, 2023 23 / 24


End of Chapter One

Question
Many Thanks!

Chapter One Introduction to Object-Oriented Programming May 25, 2023 24 / 24

You might also like