Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Object-Oriented Programming with Java: Understanding Data, Instructions, and Objects, Slides of Java Programming

An introduction to Object-Oored Programming (OOP) using Java. It covers the basics of programming, data, and the concept of objects, including their collection of data values and associated operations. The document also explains the problem-solving process and the implementation phase of writing a program in Java. Additionally, it discusses the importance of high-level programming languages and their compilation into machine code or bytecode.

Typology: Slides

2019/2020

Uploaded on 08/16/2021

jbsadik
jbsadik 🇩🇿

4 documents

Partial preview of the text

Download Object-Oriented Programming with Java: Understanding Data, Instructions, and Objects and more Slides Java Programming in PDF only on Docsity!

DCS 115

Object Oriented

Programming with Java

By

Salamudeen Alhassan

Introduction to Java

Information

Any knowledge that can be communicated including

abstract ideas and concepts such as “the Earth is

round.”

Object

A collection of data values and associated Operations.

Virtually any kind of information can be represented

as an object.

Computer program (computer programming)

Instructions defining a set of objects and

orchestrating their interactions to solve a problem

Overview of Object-Oriented

Programming

A computer is not intelligent. It cannot analyze a

problem and come up with a solution.

A human (the programmer) must analyze the

problem, develop the objects and instructions for

solving the problem, and then have the computer

carry out the instructions.

What’s the advantage of using a computer if it can’t

solve problems? Once we have written a solution for

the computer, the computer can repeat the solution

very quickly and consistently, again and again.

How Do We Write a

Program?

How Do We Write a

Program?

Problem-Solving Phase

Analysis and specification. Understand

(define) the problem and identify what the

solution must do.

General solution (algorithm). Specify the

objects and their interactions that solve the

problem.

Verify. Follow the steps exactly to see if the

solution really does solve the problem.

How Do We Write a

Program?

Maintenance Phase

Use. Use the program.

Maintain. Modify the program to meet changing

requirements or to correct any errors that show up

in using it.

How Do We Write a

Program?

Class

A description of the representation of a specific kind of

object, in terms of data and operational behaviours.

Algorithm

Instructions for solving a problem in a finite amount of

time using a finite amount of data.

A program is an algorithm that is written for a computer.

Java programs are generally referred to as applications

How Do We Write a

Program?

How Do We Write a

Program?

How Do We Write a

Program?

All data in a computer are stored and used in binary

codes, consisting of strings of 1s and 0s.

Instructions and data are stored together in the

computer’s memory using these binary codes.

Machine language

The language, made up of binary coded instructions, that

is used directly by the computer.

Assembly language

A low level programming language in which a mnemonic

represents each machine language instruction for a

particular computer.

How Is Java Code Converted into a

Form That a Computer Can Use?

Typical instructions for addition and subtraction

might look like this:

Assembly Language Machine Language

ADD 100101

SUB 010011

How Is Java Code Converted into a

Form That a Computer Can Use?

Assembly language represents a step in the right

direction, but it still forces programmers to think in

terms of individual machine instructions.

Eventually, computer scientists developed high-level

programming languages. These languages are easier

to use than assembly languages or machine code

because they are closer to English and other natural

languages.

How Is Java Code Converted into a

Form That a Computer Can Use?

Assembler

◦ A program that translates an assembly language program into

machine code.

A program called a compiler translates algorithms

written in certain high-level languages (Java, C+

+,Visual Basic, and Ada, for example) into machine

language.

Compiler

◦ A program that translates code written in a high-level language

into machine code.

How Is Java Code Converted into a

Form That a Computer Can Use?