0% found this document useful (0 votes)
5 views

1- Object Oriented Programming Java(Lecture-1) 500 2

This document outlines a course on Object-Oriented Programming using Java, focusing on problem-solving, program design, and object-oriented concepts such as classes, inheritance, and polymorphism. It covers the basics of Java, its history, various editions, and typical development environments, including the phases of creating and executing Java programs. Additionally, it highlights the importance of Java in various applications across different fields and introduces popular Java IDEs for development.

Uploaded by

x9fx4vj55q
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)
5 views

1- Object Oriented Programming Java(Lecture-1) 500 2

This document outlines a course on Object-Oriented Programming using Java, focusing on problem-solving, program design, and object-oriented concepts such as classes, inheritance, and polymorphism. It covers the basics of Java, its history, various editions, and typical development environments, including the phases of creating and executing Java programs. Additionally, it highlights the importance of Java in various applications across different fields and introduces popular Java IDEs for development.

Uploaded by

x9fx4vj55q
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/ 37

Object Oriented Programing (Java)

Introduction to Java Programming


Focus of the Course
• This is a PROJECT based course.
• Object-Oriented Software Development using Java
• problem solving
• program design, implementation, and testing
• object-oriented concepts
Classes and objects
encapsulation
inheritance
polymorphism

• graphical user interfaces (AWT, SWING)

1-2
Learning Outcome

• Should learn about the basics of Java Language


• Understand different Features of Java
• Should Know about Typical Java Development Environment
Before starting Java, Let’s understand
the general basic terminologies used in
computer programming.

4
Computer Programming
• Computer programming is the act of writing computer programs.

• A computer program is a sequence of instructions written using a


Computer Programming Language to perform a specified task by the
computer.

• A computer program is also called a computer software, which can range


from two lines to millions of lines of instructions.

5
• Computer program instructions are also called program source code
and computer programming is also called program coding.

• A computer without a computer program is just a dump box; it is


programs that make computers active.

• As we have developed so many languages to communicate among


ourselves, computer scientists have developed several computer-
programming languages to provide instructions to the computer (i.e., to
write computer programs).

6
• As we mentioned earlier, there are hundreds of programming languages,
which can be used to write computer programs and following are a few of
them −
• Java
•C
• C++
• Python
• PHP
• Perl
• Ruby
7
Uses of Computer Programs
• Today computer programs are being used in almost every field,
household, agriculture, medical, entertainment, defense, communication,
etc.
Listed below are a few applications of computer programs −

• MS Word, MS Excel, Adobe Photoshop, Internet Explorer, Chrome, etc.,


are examples of computer programs.

• Computer programs are being used to develop graphics and special


effects in movie making.

8
• Computer programs are being used to perform Ultrasounds, X-Rays, and
other medical examinations.

• Computer programs are being used in our mobile phones for SMS, Chat,
and voice communication.

9
Computer Programmer
• Someone who can write computer programs or in other words, someone
who can do computer programming is called a Computer Programmer.
• Based on computer programming language expertise, we can name
computer programmers as follow −
• C Programmer
• C++ Programmer
• Java Programmer
• Python Programmer
• PHP Programmer
• Perl Programmer
• Ruby Programmer
10
• Most of the Human Interface Languages (Hindi, English, Spanish, French,
etc.) are made of several elements like verbs, nouns, adjectives, adverbs,
prepositions, and conjunctions, etc.
• Similar to Human Interface Languages, Computer Programming
Languages are also made of several elements.
These basic elements include −

 Programming Environment  Basic Operators  Arrays


 Basic Syntax  Decision Making  Strings
 Data Types  Loops  Functions
 Variables  Numbers  File I/O
 Keywords  Characters

11
Text Editor
• A text editor is a software that is used to write computer programs.

• Popular Java Editors are:


• NetBeans
• Eclipse
• IntelliJ IDEA
• BlueJ

12
Compiler
• The computer cannot understand your program directly given in the text
format, so we need to convert this program in a binary format, which can
be understood by the computer.
• The conversion from text program to binary file is done by another
software called Compiler and this process of conversion from text
formatted program to binary format file is called program compilation.

• Finally, you can execute binary file to perform the programmed task.
• So, if you are going to write your program in any such language, which
needs compilation like C, C++, Java and Pascal, etc., then you will need to
install their compilers before you start programming.
13
The following flow diagram gives an illustration of the
process −

14
Interpreter
• There are other programming languages such as Python, PHP, and Perl,
which do not need any compilation into binary format, rather an
interpreter can be used to read such programs line by line and execute
them directly without any further conversion.

15
Introduction and basics for Java language
Page(2-21)
Text Book

Title: Java How to Program, Early Objects


Author(s): Paul Deitel, Harvey Deitel
Publisher: Pearson Education
Year: 2015
ISBN: 0133807800,9780133807806

Object Oriented Programming using Java by Simon Kendal

2019 - Modern Programming (Java) 1-17


What is Java Language
• Java is a general-purpose, high-level, Object Oriented and widely used
computer programming language.

• According to Oracle, 97% of enterprise desktops, 89% of PC desktops,


more than three billion devices run Java, and there are over 9 million Java
developers.
Java History
• Sun Microsystems in 1991 funded an internal
Version Date

corporate research project led by James JDK Beta 1995


JDK1.0 January 23, 1996

Gosling, which resulted in creating Java JDK 1.1 February 19, 1997
J2SE 1.2 December 8, 1998

Language J2SE 1.3 May 8, 2000


J2SE 1.4 February 6, 2002

• To write programs that will run on a great J2SE 5.0


Java SE 6
September 30, 2004
December 11, 2006
Java SE 7 July 28, 2011
variety of computer systems and computer- Java SE 8 March 18, 2014 (LTS)
Java SE 9 September 21, 2017
controlled devices. Java SE 10 March 20, 2018
Java SE 11 September 25, 2018 (LTS)

• This is sometimes called “write once, run Java SE 12


Java SE 13
March 19, 2019
September 17, 2019
Java SE 14 March 17, 2020 (LTS)
anywhere.”
Java History
• Java was developed by James Gosling, Patrick Naughton, Mike Sheridan at
Sun Microsystems Inc. in 1991. It took 18 months to develop the first working
version.

• The initial name was Oak but it was renamed to Java in 1995 as OAK was a
registered trademark of another Tech company.
Java Editions
• 1. Java Standard Edition

• 2. Java Micro Edition

• 3. Java Enterprise Edition

• 4. JavaFX
Java Editions
• 1. JSE(Java Standard Edition)
• Java Standard edition is a computing platform which is used for development and deployment of
portable code that is used in desktop and server environments. Java Standard Edition is also known
as Java 2 Platform, Standard Edition (J2SE).

• Java Standard Edition has a wide range of APIs such as Java Class Library etc. the best implementation
of Java SE is Oracle Corporation’s Java Development Kit (JDK).
• This edition can be used for developing standalone software/applications.

• Stand-alone software is any software application that's not bundled with other software, nor does it
require anything else to run. Essentially, it's software that can "stand on its own," without help from
the internet or another computer process.
• Windows, IOS, android, OS x and Linux
Java Editions
2. JEE(Java Enterprise Edition)
• Java Enterprise Edition is a set of specifications and extending Java SE 8
with features such as distributed computing and web services. The
applications of Java Enterprise Edition run on reference runtimes. This
reference runtime handle transactions, security, scalability, concurrency
and the management of components to be deployed. Java Enterprise
Edition is also known as Java 2 Platform Enterprise Edition (J2EE), and
currently, it has been rebranded as Jakarta EE.
• This edition can be used for developing web based software/applications.
• Example: e-commerce, accounting, banking information systems.
Java Editions
3. JME(Java Micro Edition)
• Java Micro Edition is a computing platform which is used for the development
and deployment of portable codes for the embedded and mobile devices. Java
Micro Edition is also known as Java 2 Platform Micro Edition (J2ME). The Java
Micro Edition was designed by Sun Microsystems and then later on Oracle
corporation acquired it in 2010.
• This edition can be used for developing applications for mobile devices, wireless devices,
embedded controllers, remote controllers where memory is limited.

• Example: micro-controllers, sensors, gateways, mobile phones, printers etc.


Java Editions
• 4. JavaFX
• JavaFX is used for creating desktop applications and also rich internet
applications(RIAs) which can be run on a wide variety of devices. JavaFX
has almost replaced Swing as the standard GUI library for Java Standard
Edition. JavaFX support for desktop computers and web browsers.
Applications of Java

• According to Sun, 3 billion devices run Java. There are many devices where
Java is currently used. Some of them are as follows:
• Desktop Applications such as acrobat reader, media player, antivirus, etc.
• Web Applications such as irctc.co.in, javatpoint.com, etc.
• Enterprise Applications such as banking applications.
• Mobile
• Embedded System
• Smart Card
• Robotics
• Games, etc.
Types of Programming languages

• Programmers write instructions in various programming languages, there


are three general types of them:

• Machine Language
• Assembly Language
• High-Level language Java (Bytecode )-> JVM -> Assembly -> Machine

• Java is a high-level programming Language


Typical Java Development
Environment
• Normally there are five phases
to create and execute Java
programs:

1. Edit,
2. Compile,
3. Load
4. Verify
5. Execute.
Phase 1
• Editing (Writing the Program)
• Consists of editing a file with an editor program, normally known simply
as an editor
• Using the editor, you type a Java program, which is called source code
• You store the source code as: filename.java
Phase 2
• Compiling a Java Program into Bytecodes
• Compiler produces a .class file such s: filename.class that contains the
compiled version
• The Java Virtual Machine (JVM)—a part of the JDK and the foundation of
the Java platform—executes bytecodes.
Phase 3
• Loading a Program into Memory
• The JVM places the program in memory to execute it—this is known as
loading
Phase 4
• Bytecode Verification
• The bytecode verifier examines their bytecodes to ensure that they’re
valid and do not violate Java’s security restrictions
Phase 5
• Execution:
• The JVM executes the program’s bytecodes, thus performing the actions
specified by the program
Integrated Development Environment
• IDEs provide tools that support the software development process, such
as:
• Editors
• Debuggers for locating logic errors and more.
• There are many popular Java IDEs, including:

• NetBeans (www.netbeans.org)
• Eclipse (www.eclipse.org)
• IntelliJ IDEA (www.jetbrains.com)

• We will use Netbeans for this interactive course 


Hello world example
• The traditional Hello world program can be written in Java as:
Thank You…!

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy