Intermediate Programming (Java) 1: Course Title: Getting Started With Java Language
Intermediate Programming (Java) 1: Course Title: Getting Started With Java Language
Intermediate Programming (Java) 1: Course Title: Getting Started With Java Language
MODULE: 1
OVERVIEW
Getting started with Java Language
History Tools You Will Need
Java is… Local Environment Setup
Popular Java Editors
MODULE OUTCOMES
At the end of this module, the students must have:
discussed the origin and recent releases of Java Programming Language;
distinguised the advantages of Java compare to other programming languages;
installed Java Application;
differentiated the different popular Java editors.
INTRODUCTION
Java programming language was originally developed by Sun Microsystems which was initiated by
James Gosling and released in 1995 as core component of Sun Microsystems' Java platform (Java 1.0
[J2SE]).
The latest release of the Java Standard Edition is Java SE 8. With the advancement of Java and its
widespread popularity, multiple configurations were built to suit various types of platforms. For
example: J2EE for Enterprise Applications, J2ME for Mobile Applications.
The new J2 versions were renamed as Java SE, Java EE, and Java ME respectively. Java is guaranteed
to be Write Once, Run Anywhere.
DISCUSSION
History of Java
James Gosling initiated Java language project in June 1991 for use in one of his many set-top box
projects. The language, initially called ‘Oak’ after an oak tree that stood outside Gosling's office, also
went by the name ‘Green’ and ended up later being renamed as Java, from a list of random words.
Sun released the first public implementation as Java 1.0 in 1995. It promised Write Once, Run
Anywhere (WORA), providing no-cost run-times on popular platforms.
On 13 November, 2006, Sun released much of Java as free and open source software under the terms
of the GNU General Public License (GPL).
On 8 May, 2007, Sun finished the process, making all of Java's core code free and open-source, aside
from a small portion of code to which Sun did not hold the copyright.
There are several Java platforms. Many developers, even long-time Java programming language
developers, do not understand how the different platforms relate to each other.
All Java platforms consist of a Java Virtual Machine (VM) and an application programming interface
(API). The Java Virtual Machine is a program, for a particular hardware and software platform, that
runs Java technology applications. An API is a collection of software components that you can use to
create other software components or applications. Each Java platform provides a virtual machine and
an API, and this allows applications written for that platform to run on any compatible system with all
the advantages of the Java programming language: platform-independence, power, stability, ease-of-
development, and security.
Java SE
When most people think of the Java programming language, they think of the Java SE API. Java SE's
API provides the core functionality of the Java programming language. It defines everything from the
basic types and objects of the Java programming language to high-level classes that are used for
networking, security, database access, graphical user interface (GUI) development, and XML parsing.
In addition to the core API, the Java SE platform consists of a virtual machine, development tools,
deployment technologies, and other class libraries and toolkits commonly used in Java technology
applications.
Java EE
The Java EE platform is built on top of the Java SE platform. The Java EE platform provides an API and
runtime environment for developing and running large-scale, multi-tiered, scalable, reliable, and secure
network applications.
Java ME
The Java ME platform provides an API and a small-footprint virtual machine for running Java
programming language applications on small devices, like mobile phones. The API is a subset of the
Java SE API, along with special class libraries useful for small device application development. Java ME
applications are often clients of Java EE platform services.
Java FX
Java FX technology is a platform for creating rich internet applications written in Java FX ScriptTM.
Java FX Script is a statically-typed declarative language that is compiled to Java technology bytecode,
which can then be run on a Java VM. Applications written for the Java FX platform can include and link
to Java programming language classes, and may be clients of Java EE platform services.
Java is −
Object Oriented − In Java, everything is an Object. Java can be easily extended since it is
based on the Object model.
Platform Independent − Unlike many other programming languages including C and C++,
when Java is compiled, it is not compiled into platform specific machine, rather into platform
independent byte code. This byte code is distributed over the web and interpreted by the
Virtual Machine (JVM) on whichever platform it is being run on.
Simple − Java is designed to be easy to learn. If you understand the basic concept of OOP
Java, it would be easy to master.
Secure − With Java's secure feature it enables to develop virus-free, tamper-free systems.
Authentication techniques are based on public-key encryption.
Architecture-neutral − Java compiler generates an architecture-neutral object file format,
which makes the compiled code executable on many processors, with the presence of Java
runtime system.
Portable − Being architecture-neutral and having no implementation dependent aspects of the
specification makes Java portable. Compiler in Java is written in ANSI C with a clean portability
boundary, which is a POSIX subset.
Robust − Java makes an effort to eliminate error prone situations by emphasizing mainly on
compile time error checking and runtime checking.
Multithreaded − With Java's multithreaded feature it is possible to write programs that can
perform many tasks simultaneously. This design feature allows the developers to construct
interactive applications that can run smoothly.
Interpreted − Java byte code is translated on the fly to native machine instructions and is not
stored anywhere. The development process is more rapid and analytical since the linking is an
incremental and light-weight process.
High Performance − With the use of Just-In-Time compilers, Java enables high performance.
Distributed − Java is designed for the distributed environment of the internet.
Dynamic − Java is considered to be more dynamic than C or C++ since it is designed to adapt
to an evolving environment. Java programs can carry extensive amount of run-time
information that can be used to verify and resolve accesses to objects on run-time.
Environment Setup
Activity No. 1
Name: Date:
Year and Section: Signature:
(20 points) Research on the latest Java Platform SE release. What are the New Features and
Enhancements?
Activity No. 2
Name: Date:
Year and Section: Signature:
(20 points) Choose one Java Editor and research on its history.
SUMMARY
Put a check on the topic whether you can understand it on your own, need more reference material, or
if you can’t understand.
SELF ASSESSMENT
I CAN DO IT WITH
I CAN DO IT ON MY THE HELP OF A I CANNOT
OWN. REFERENCE UNDERSTAND.
MATERIAL.
Getting started with
Java Language
Please write your written feedback below:
Name: Date:
Year and Section: Signature:
REFERENCES
1. CADENHEAD, R. (2018). SAMS TEACH YOURSELF JAVA IN 21 DAYS. 800 EAST 96TH
STREET, INDIANAPOLIS, INDIANA 46240. PEARSON EDUCATION.
2. ECK,D.(2017). INTRODUCTION TO PROGRAMMING USING JAVA. HOBART AND WILLIAM
SMITH COLLEGES, GENEVA, NY 14456
3. MEDLEY, R. (2018, JUNE 7). NETBEANS. RETRIEVED FROM NETBEANS.ORG:
HTTPS://EDU.NETBEANS.ORG/CONTRIB/JEDI/INTRO-TO-PROGRAMMING- 1/COURSE-
OUTLINE.PDF
4. SHICHT, H. (2018, JUNE 7). COMPUTER_FUNDAMENTALS. RETRIEVED FROM
TUTORIALSPOINT.COM:
HTTPS://WWW.TUTORIALSPOINT.COM/COMPUTER_FUNDAMENTALS/COMPUTER_NUMBER
_SYSTEM.HTM
SUGGESTED READINGS
1. HTTPS://WWW.W3SCHOOLS.COM/JAVA/
2. HTTPS://WWW.TUTORIALSPOINT.COM/JAVA/INDEX.HTM
PRIMITIVE DATA TYPES IN JAVA
O INTRODUCTION
O SYNTAX
O CONVERTING PRIMITIVES
O MEMORY CONSUMPTION OF PRIMITIVES VS. BOXED PRIMITIVES
O NEGATIVE VALUE REPRESENTATION
O PRIMITIVE TYPES CHEATSHEET
O THE BOOLEAN PRIMITIVE
O THE BYTE PRIMITIVE
O THE CHAR PRIMITIVE
O THE DOUBLE PRIMITIVE
O THE FLOAT PRIMITIVE
O THE INT PRIMITIVE
O THE LONG PRIMITIVE
O THE SHORT PRIMITIVE
OPERATORS IN JAVA
O INTRODUCTION
O REMARKS
O THE ARITHMETIC OPERATORS (+, -, *, /, %)
O THE ASSIGNMENT OPERATORS (=, +=, -=, *=, /=, %=, <<=, >>= , >>>=, &=, |= AND ^=)
O THE BITWISE AND LOGICAL OPERATORS (~, &, |, ^)
O THE THE CONDITIONAL-AND AND CONDITIONAL-OR OPERATORS ( && AND || ) CONDITIONAL
OPERATOR (? :)
O THE EQUALITY OPERATORS (==, !=)
O THE INCREMENT/DECREMENT OPERATORS (++/--)
O THE INSTANCEOF OPERATOR
O THE LAMBDA OPERATOR ( -> )
O THE RELATIONAL OPERATORS (<, <=, >, >=)
O THE SHIFT OPERATORS (<<, >> AND >>>)
O THE STRING CONCATENATION OPERATOR (+)
STRINGS IN JAVA
O INTRODUCTION
O REMARKS
O ADDING TOSTRING() METHOD FOR CUSTOM OBJECTS
O CASE INSENSITIVE SWITCH
O CHANGING THE CASE OF CHARACTERS WITHIN A STRING
O COMPARING STRINGS
O COUNTING OCCURRENCES OF A SUBSTRING OR CHARACTER IN A STRING
O FINDING A STRING WITHIN ANOTHER STRING
O GETTING THE LENGTH OF A STRING
O GETTING THE NTH CHARACTER IN A STRING
O JOINING STRINGS WITH A DELIMITER
O PLATFORM INDEPENDENT NEW LINE SEPARATOR
O REMOVE WHITESPACE FROM THE BEGINNING AND END OF A STRING
O REPLACING PARTS OF STRINGS
O REVERSING STRINGS
O SPLITTING STRINGS
O STRING CONCATENATION AND STRINGBUILDERS
O STRING POOL AND HEAP STORAGE
O SUBSTRINGS
BASIC CONTROL STRUCTURES
O INTRODUCTION
O REMARKS
O BREAK
O CONTINUE STATEMENT IN JAVA
O DO...WHILE LOOP
O FOR EACH
O FOR LOOPS
O IF / ELSE
O IF / ELSE IF / ELSE CONTROL
O NESTED BREAK / CONTINUE
O SWITCH STATEMENT
O TERNARY OPERATOR
O TRY ... CATCH ... FINALLY
O WHILE LOOPS
CLASSES AND OBJECTS
O INTRODUCTION
O SYNTAX
O BASIC OBJECT CONSTRUCTION AND USE
O CONSTRUCTORS
O EXPLAINING WHAT IS METHOD OVERLOADING AND OVERRIDING
O INITIALIZING STATIC FINAL FIELDS USING A STATIC INITIALIZER
O OBJECT MEMBER VS STATIC MEMBER
O OVERLOADING METHODS
O SIMPLEST POSSIBLE CLASS
ARRAYS
O INTRODUCTION
O SYNTAX
O PARAMETERS
O ARRAY COVARIANCE
O ARRAYINDEXOUTOFBOUNDSEXCEPTION
O ARRAYS TO A STRING
O ARRAYS TO STREAM
O CASTING ARRAYS
O COMPARING ARRAYS FOR EQUALITY
O CONVERTING ARRAYS BETWEEN PRIMITIVES AND BOXED TYPES
O COPYING ARRAYS
O CREATING A LIST FROM AN ARRAY
O CREATING AN ARRAY FROM A COLLECTION
O CREATING AND INITIALIZING ARRAYS
O FINDING AN ELEMENT IN AN ARRAY
O GETTING THE LENGTH OF AN ARRAY
O HOW DO YOU CHANGE THE SIZE OF AN ARRAY?
O ITERATING OVER ARRAYS
O MULTIDIMENSIONAL AND JAGGED ARRAYS
O REMOVE AN ELEMENT FROM AN ARRAY
O SORTING ARRAYS
ORACLE OFFICIAL CODE STANDARD
O INTRODUCTION
O REMARKS
O ANNOTATIONS
O BRACES
O CLASS STRUCTURE
O IMPORT STATEMENTS
O INDENTATION
O JAVA SOURCE FILES
O LAMBDA EXPRESSIONS
O LITERALS
O MODIFIERS
O NAMING CONVENTIONS
O PACKAGE DECLARATION
O REDUNDANT PARENTHESES
O SPECIAL CHARACTERS
O VARIABLE DECLARATIONS
O WHITESPACE
O WRAPPING EXPRESSIONS
O WRAPPING METHOD DECLARATIONS
o WRAPPING STATEMENTS