1- Object Oriented Programming Java(Lecture-1) 500 2
1- Object Oriented Programming Java(Lecture-1) 500 2
1-2
Learning Outcome
4
Computer Programming
• Computer programming is the act of writing computer programs.
5
• Computer program instructions are also called program source code
and computer programming is also called program coding.
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 −
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 −
11
Text Editor
• A text editor is a software that is used to write computer programs.
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
Gosling, which resulted in creating Java JDK 1.1 February 19, 1997
J2SE 1.2 December 8, 1998
• 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
• 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.
• 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
• Machine Language
• Assembly Language
• High-Level language Java (Bytecode )-> JVM -> Assembly -> Machine
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)