Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

programming

Rating
-
Sold
-
Pages
8
Uploaded on
16-06-2023
Written in
2022/2023

covers all programming languages including (java,C++,and c)

Institution
Course

Content preview

INTRODUCTION
Java was originally called Oak but upon discovering there was another programming language with the same
name, the development team renamed it to Java after one of the brands of coffee. The language grew out of a
project to develop a personal digital assistance [PDA], i.e., a device that was intended to control all electronic
devices used in homes.
Java is a true OO language and therefore the underlying structure of all Java programs is classes. Generally, a
class serves as a template or blueprint for an object and behaves like a basic data type “int”. It is therefore
important to understand how the fields and methods are defined in a class and how they are used to build a Java
program that incorporates the basic OO concepts such as encapsulation, inheritance, and polymorphism.

Characteristics of java
Java attempts to overcome the limitations of its predecessors and as such it is designed to be:
i). Simple: - Java has much in common with C++ but does not have some features that are present in
C++. These features make C++ very powerful but are also very dangerous when in the wrong
hands.
ii). Object oriented: - In java, data and process are encapsulated together to provide objects that have
both state [data] and behavior [process]. This makes it easier for the programmer to model real
world things [objects].
iii). Distributed: - Java is designed for network programming and can easily work with common
internet protocols such as HTTP (hypertext transfer protocol) and FTP (file transfer protocol). It
provides facilities to write systems where programs are distributed across many computers.
iv). Robustness: - A robust program is one that does not behave unpredictably or fail due to
programmer error. Java is more robust compared to other languages because it does not allow
programmers to have direct access to the memory. This is so because pointers are not used in java.
v). Secure: - Java has inbuilt security systems that ensure a code once written is not easy to tamper
with. There are also a number of restrictions placed on what applets can do when they are running
on a remote machine.
vi). Multithreaded: -Java allows many simultaneous activities in one program via the Thread class.
The major benefits are better interactive performance and real-time behavior. For example, images
can be loaded with one thread, while user accesses the HTML information on a Web page.
vii). Architecture neutrality/Platform independent/portability: - Java programs once written can be
run on different operating systems. This is made possible by combining compilation and
interpretation of the source code.

JAVA PLATFORM
It refers to both hardware and software;
 Java Virtual Machine (JVM): A layer above the physical hardware of any given machine on which java
code executes. This makes Java platform independent. The JVM is an imaginary machine that interprets the
byte code to run on a specific hardware.
 Application Programming Interface (API): A set of inbuilt modules to do common tasks. Java library is
made of packages which in turn are made of classes for common repetitive tasks. Programmers reuse the
packages making programming in java easy.




Object oriented Programming Page 1 of 8

, JDK Editions
 Java Standard Edition: - It is used to develop client-side standalone applications or applets.
 Java Enterprise Edition: - It is used to develop server-side applications such as Java servlets and Java Server
Pages.

Java Programming Environments
Like other Languages, there are three environments:
 Editor – Source code written and edited using text editor. File saved with .java extension
 Compiler – Source code translated into byte code and saved in a file with .class extension. The byte code
can be executed on many different kinds of computers. javac program is used to compile.
 Execution – java launcher is used to interpret and execute the program.
In command line, the three environments are separate. The following diagram illustrates the Java programming
process




Java IDE Tools
An IDE combines the three environment into one. The following are some common IDEs :
 Borland JBuilder
 JCreator
 Eclipse by IBM
 BlueJ
 NetBeans by Sun Microsystems, etc.

Java Program Types
 Application: - Standalone Java program that can run independent of any Web browser
 Applet: - Java program that runs within a Java-enabled Web browser
 Servlet: -Java software that is loaded into a Web server to provide additional server functionality similar to
CGI programs

Structure of Java programs
All java programs assume a structure similar to the one shown below.
package packagename;
import java.packagename.*;
[access modifier] class classname [extends superclassname][implements
interfacenamee]
{
//member variable declarations.
type variable name;
//method implementations.
[access modifier] returntype methodname(method parameters)
{
statements in method block;
}// end of method defination
}//end of class definition.
The package keyword is used in the package statement to create or define the package to which a class belongs.
It is optional and when left out, the program is automatically placed in the default package.

Object oriented Programming Page 2 of 8

Written for

Institution
Course

Document information

Uploaded on
June 16, 2023
Number of pages
8
Written in
2022/2023
Type
Class notes
Professor(s)
Mbuki
Contains
All classes

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
jokerinnit54

Get to know the seller

Seller avatar
jokerinnit54 KCA university
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
3
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions