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

COM 413 Lesson 1

The document provides an introduction to Java, detailing its history, features, and comparison with C++. It emphasizes Java's object-oriented nature, platform independence, and its role in various applications, while also discussing the Java Development Kit and Java Virtual Machine. Additionally, it highlights the importance of learning Java for career opportunities in programming and software development.

Uploaded by

edwinmurimi902
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

COM 413 Lesson 1

The document provides an introduction to Java, detailing its history, features, and comparison with C++. It emphasizes Java's object-oriented nature, platform independence, and its role in various applications, while also discussing the Java Development Kit and Java Virtual Machine. Additionally, it highlights the importance of learning Java for career opportunities in programming and software development.

Uploaded by

edwinmurimi902
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

COM 413 / COE 301 / COE 361

OBJECT ORIENTED PROGRAMMING.


CHAPTER 1:
Introduction To Java Basics
BY SAMWEL TARUS
1. BASIC CONCEPTS
Introduced by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and
Mike Sheridan at Sun Microsystems in 1991.
Released in 1995 as core component of Sun Microsystems’ Java platform (Java
1.0 [J2SE]).
Powerful general purpose / practical and widely used OOP
Designed for the development of s/w for consumer electronic devices like TVs,
VCRs, car alarms, Toasters, and other electronic machines, programming games
and creating mission-critical applications.
Java has built-in support to create programs with graphical user interface (GUI),
utilize internet, create client-server solutions, etc.
Programs written in Java can run without change on any of the common operating
systems eg Windows 95/NT, Macintosh, Unix and in any hardware platforms.
Java is closely related to C, and C++.
Simple, Portable, and highly reliable.
COMPARISON OF JAVA AND C++
Java C++
Pure/true Object oriented language C with Object-oriented extension.
Does not support operator Supports operator overloading.
overloading.
It supports labels with loops and It supports goto statement.
statement blocks.
Source code can be written to be
Compiled into byte code for the Java
platform independent and written to
Virtual Machine. Code is take advantage of platform. C++
independent on operating system. typically compiled into machine code.
PTO….
Java C++
Does not support multiple inheritance Supports multiple inheritance of
of classes but it supports interface. classes.
Runs in a protected virtual machine. Exposes low-level system facilities

Does not use pointers. Uses pointers.

It strictly enforces an object oriented Allows both procedural programming


programming paradigm and object oriented programming.
No header files used. Use header files
RELATIONSHIP BETWEEN C,C++, AND JAVA
Why computer language innovation?

Computer language innovation and development occurs for two fundamental


reasons:
 To adapt to changing environments and uses.
 To implement refinements and improvements in the art of programming
WHY LEARN JAVA?
 General-purpose programming language that’s used in all industries for almost
any type of application.
 The Java language is object-oriented (OO), which allows you to easily relate
program constructs to objects from the real world
 Java provides employment. To improve your value and employability you need to
master not only the syntax of the language, but also the right set of Java-related
technologies that are in demand.
 Java is an open-source software. millions of open-source projects are being
developed in Java. Joining one of these projects is the best way to get familiar
with the process of project development and secure your very first job without
having any prior real-world experience as a programmer.

 Java provides plenty of technical features that make Java the right choice for many
projects.
FEATURES OF JAVA PROGRAMMING LANGUAGE
 Simple, Small and Familiar: like C, C++. No pointers, multiple inheritance
 Object-Oriented.
 Compiled and Interpreted.
 Platform Independent.
 Secured: java.Security.package. JAAS(Java Authentication and Authorization Services) for
distributed applications. No pointerss
 Robust: Java has strict compile time checking for data type, garbage collected L. exception H
 Distributed.
 Portable.
 Architectural Neutral.
 Multithreaded and Interactive.
 Dynamic and Extensible
JAVA ENVIRONMENT
1. Java Development Kit (JDK): - Includes a number of development tools
 It includes:
Appletviewer (used for viewing the applet)
Javac (It is a Java Compiler)
Java (java interpreter)
Javap (Java diassembler, which convert byte code into program description)
Javah (It is for java C header files).
Javadoc (for creating HTML document)
Jdb (It is Java debugger).
Jar (tool also helps manage JAR files.)
2. Java Standard Library (JSL): - Includes classes and methods.
 Also known as the Application Programming Interface (API).
 Eg., java.applet, java.Scanner, Java.util etc (packages)
JDK
• JDK=JRE+Development Tools
JAVA VIRTUAL MACHINE
 Program whose purpose is to execute other programs.
 Programming language compilers convert the source code to machine code.
 Java compiler converts the source code into Intermediate code called the byte
code. This machine is called the Java Virtual machine and it exits only inside the
computer memory.

• Functions of JVM:
 To allow Java programs to run on any device or operating system (known as the
"Write once, run anywhere" principle)
 To manage and optimize program memory.
//Java demo program
public class Test
{
public static void main(String[] args)
{
//code put here
}
}
Pto…
 The Virtual machine code is not machine specific. The machine specific code is
generated by Java interpreter by acting as an intermediary between the virtual
machine and real machines as shown below:

You might also like