0% found this document useful (0 votes)
4 views4 pages

COS201 Lecture 3

The document provides an overview of Java programming, highlighting its characteristics as a high-level, object-oriented language designed for portability and performance. It discusses Java's history, its relation to Android development, and its various applications across different platforms. Additionally, it outlines the necessary tools for setting up a Java programming environment and includes an assignment related to Java programming tools and installation.

Uploaded by

wwwtope947
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)
4 views4 pages

COS201 Lecture 3

The document provides an overview of Java programming, highlighting its characteristics as a high-level, object-oriented language designed for portability and performance. It discusses Java's history, its relation to Android development, and its various applications across different platforms. Additionally, it outlines the necessary tools for setting up a Java programming environment and includes an assignment related to Java programming tools and installation.

Uploaded by

wwwtope947
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/ 4

ACHIEVERS UNIVERSITY, OWO

COLLEGE OF NATURAL AND APPLIED SCIENCES


DEPARTMENT OF COMPUTER SCIENCE
COS 201 – COMPUTER PROGRAMMING I – 3 UNITS

LECTURER IN CHARGE - MR. ADEPOJU, S. E.

LECTURE 3

JAVA PROGRAMMING
Introduction
Java is a high-level, class-based, object-oriented programming language that is designed to have
as few implementation dependencies as possible. It is a general-purpose programming language
intended to let programmers write once, run anywhere (WORA), meaning that compiled Java
code can run on all platforms that support Java without the need to recompile. Java applications
are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of
the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer
low-level facilities than either of them. The Java runtime provides dynamic capabilities (such as
reflection and runtime code modification) that are typically not available in traditional compiled
languages.

Brief history
Java gained popularity shortly after its release, and has been a very popular programming
language since then. Java was the third most popular programming language in 2022 according
to GitHub. Although still widely popular, there has been a gradual decline in use of Java in
recent years with other languages using JVM gaining popularity.
Java was originally developed by James Gosling at Sun Microsystems. It was released in May
1995 as a core component of Sun's Java platform. The original and reference implementation
Java compilers, virtual machines, and class libraries were originally released by Sun under
proprietary licenses. As of May 2007, in compliance with the specifications of the Java
Community Process, Sun had relicensed most of its Java technologies under the GPL-2.0-only
license. Oracle offers its own HotSpot Java Virtual Machine, however the official reference
implementation is the OpenJDK JVM which is free open-source software and used by most
developers and is the default JVM for almost all Linux distributions.
As of September 2024, Java 23 is the latest version (Java 22, and 20 are no longer maintained).
Java 8, 11, 17, and 21 are previous LTS versions still officially supported.
Java software runs on everything from laptops to data centers, game consoles to scientific
supercomputers.
Principles
There were five primary goals in creating the Java language:
1. It must be simple, object-oriented, and familiar.
2. It must be robust and secure.
3. It must be architecture-neutral and portable.
4. It must execute with high performance.
5. It must be interpreted, threaded, and dynamic.

Relation of Java with Android


The Java language is a key pillar in Android, an open source mobile operating system. Although
Android, built on the Linux kernel, is written largely in C, the Android Software Development
Kit (SDK) uses the Java language as the basis for Android applications but does not use any of
its standard GUI, SE, ME or other established Java standards. The bytecode language supported
by the Android SDK is incompatible with Java bytecode and runs on its own virtual machine,
optimized for low-memory devices such as smartphones and tablet computers. Depending on the
Android version, the bytecode is either interpreted by the Dalvik virtual machine or compiled
into native code by the Android Runtime.
Android does not provide the full Java SE standard library, although the Android SDK does
include an independent implementation of a large subset of it. It supports Java 6 and some Java 7
features, offering an implementation compatible with the standard library (Apache Harmony).

Uses of Java
Java is a popular programming language owned by Oracle, and more than 3 billion devices run
Java. It is used for:
1. Mobile applications (specially Android apps)
2. Desktop applications
3. Web applications
4. Web servers and application servers
5. Games
6. Database connection

Benefits of Java
1. Java works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc.)
2. It is one of the most popular programming languages in the world
3. It has a large demand in the current job market
4. It is easy to learn and simple to use
5. It is open-source and free
6. It is secure, fast and powerful
7. It has huge community support (tens of millions of developers)
8. Java is an object oriented language which gives a clear structure to programs and allows
code to be reused, lowering development costs.
9. As Java is close to C++ and C#, it makes it easy for programmers to switch to Java or
vice versa

Setting up the environment in Java


If you are willing to set up your environment for Java, you need to have the following two
software on your computer.
1. Source code Editor: This will be used to type your program. Examples of a few editors
include Windows Notepad, Notepad++, Sublime Text, NetBeans, Visual Studio Code,
EMACS, and vim or vi. Name and version of the text editor can vary on different operating
systems. For example, Notepad will be used on Windows and vim or vi can be used on
windows as well as Linux, or UNIX. The files you create with your editor are called source
files and for Java they typically are named with the extension .java. A text editor should be
in place to start your Java programming.
It is possible to write Java in an Integrated Development Environment (IDE), such as IntelliJ
IDEA, NetBeans or Eclipse, which are particularly useful when managing larger collections
of Java files. IDE provides all common tools and facilities to aid in programming, such as
source code editor, build tools and debuggers etc.

2. JRE (Java Runtime Environment): JRE contains the parts of the Java libraries required to
run Java programs and is intended for end-users. JRE can be viewed as a subset of JDK. JDK
(Java Development Kit): JDK is intended for software developers and includes development
tools such as the Java compiler, Javadoc, Jar, and a debugger. JVM: JVM (Java Virtual
Machine) is an abstract machine. It is a specification that provides a runtime environment in
which java bytecode can be executed. JVMs are available for many hardware and software
platforms.

3. Online Java Compiler (Optional): We have various online Java Programming


environments online, so that you can compile and execute all Java source codes online. You
can use an online Java compiler from anywhere with an internet connection, on a desktop,
laptop, or mobile device. You don't need to download or install any software to use an online
Java compiler. Online compiler has both the source code editor and the JRE.

Some PCs might have Java already installed. To check if you have Java installed on a Windows
PC, search in the start bar for Java or type the following in Command Prompt (cmd.exe):
C:\Users\Your Name>java -version

If Java is installed, you will see something like this (depending on version):
java version "22.0.0" 2024-08-21 LTS
Java(TM) SE Runtime Environment 22.9 (build 22.0.0+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 22.9 (build 22.0.0+13-LTS, mixed mode)

If you do not have Java installed on your computer, you can download it for free at oracle.com

ASSIGNMENT
1) Enumerate tools required for writing, compiling and running Java programs.
2) Describe how you’ve installed the Java SE (Standard Edition) on any available computer
system.

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