0% found this document useful (0 votes)
3 views73 pages

Java Chapter 1

The document provides an introduction to Java, detailing its history, features, and various applications. It covers the evolution of Java from its inception in 1991 to its current version, Java SE 23. Additionally, it explains key concepts such as Java's platform independence, data types, and the roles of JDK, JRE, and JVM.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views73 pages

Java Chapter 1

The document provides an introduction to Java, detailing its history, features, and various applications. It covers the evolution of Java from its inception in 1991 to its current version, Java SE 23. Additionally, it explains key concepts such as Java's platform independence, data types, and the roles of JDK, JRE, and JVM.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 73

Chapter 1

JAVA INTRODUCTION
HISTORY OF JAVA
► James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java
language project in June 1991. The small team of sun engineers called Green
Team.

► Initially it was designed for small, embedded systems in electronic appliances


like set-top boxes.

► Firstly, it was called "Greentalk" by James Gosling, and the file extension
was .gt.

► After that, it was called Oak and was developed as a part of the Green project

► Why Oak? Oak is a symbol of strength and chosen as a national tree of many
countries like the U.S.A., France, Germany, Romania, etc.

► In 1995, Oak was renamed as "Java" because it was already a trademark by


Oak Technologies.
HISTORY OF JAVA
► Why had they chose the name Java for Java language? The team
gathered to choose a new name. The suggested words were "dynamic",
"revolutionary", "Silk", "jolt", "DNA", etc. They wanted something that
reflected the essence of the technology: revolutionary, dynamic, lively,
cool, unique, and easy to spell, and fun to say.

► According to James Gosling, "Java was one of the top choices along
with Silk". Since Java was so unique, most of the team members
preferred Java than other names.

► Java is an island in Indonesia where the first coffee was produced


(called Java coffee). It is a kind of espresso bean. Java name was
chosen by James Gosling while having a cup of coffee nearby his
office.

► Notice that Java is just a name, not an acronym.


HISTORY OF JAVA
► In 1995, Time magazine called Java one of the Ten Best Products of
1995.

► JDK 1.0 was released on January 23, 1996.

► After the first release of Java, there have been many additional features
added to the language.

► Now Java is being used in Windows applications, Web applications,


enterprise applications, mobile applications, cards, etc.

► Each new version adds new features in Java.


JAVA VERSION HISTORY
► Many java versions have been released till now.
► The current stable release of Java is Java Platform, Standard Edition 23 (Java SE
23.0.2)
► Since Java SE 8 release, the Oracle corporation follows a pattern in which every
even version is release in March month and an odd version released in September
month.
Java version releases Java version releases(release every six months)

1. JDK Alpha and Beta (1995) 11. Java SE 9 (21st Sep 2017)
2. JDK 1.0 (23rd Jan 1996) 12. Java SE 10 (20th Mar 2018)
3. JDK 1.1 (19th Feb 1997) 13. Java SE 11 (September 2018)
4. J2SE 1.2 (8th Dec 1998) 14. Java SE 12 (March 2019)
5. J2SE 1.3 (8th May 2000) 15. Java SE 13 (September 2019)
6. J2SE 1.4 (6th Feb 2002) 16. Java SE 14 (Mar 2020)
7. J2SE 5.0 (30th Sep 2004) 17. Java SE 15 (September 2020)
8. Java SE 6 (11th Dec 2006) 18. Java SE 16 (Mar 2021)
9. Java SE 7 (28th July 2011) 19. Java SE 17 (September 2021)
20. Java SE 18 (to be released by March
10. Java SE 8 (18th Mar 2014)
2022)
WHAT IS JAVA?
► Java is a high-level, general-purpose, object-oriented, platform independent and secure programming
language developed by James Gosling at Sun Microsystems, Inc. in 1991.
► Types of Java Applications
 Standalone/Desktop Applications
 Enterprise/Web Applications
 Mobile Applications
 Microdevice and IoT apps
► Java Editions / Platforms
 Java Platform, Standard Edition (Java SE)
 Java Platform, Enterprise Edition (Java EE)
 Java Platform, Micro Edition (Java ME)
 Java FX
JAVA’S MAGIC: THE BYTE CODE
► The means that allows Java to solve both the security and the portability problems is
that the output of a Java compiler is not executable code but it is the Bytecode.

► Bytecode is a highly optimized set of instructions designed to be executed by the Java


run-time system, which is called the Java Virtual Machine (JVM).

► JVM is an interpreter for bytecode.

► The fact that a Java program is executed by JVM helps solve the major problems
associated with downloading programs over the Internet. Translating a Java program
into bytecode helps makes it much easier to run a program in a wide variety of
environments.

► This is because only the JVM needs to be implemented for each platform.

► Hence this makes Java Program Platform Independent.


JAVA BUZZWORDS / FEATURES
► Simple
► Object-Oriented
► Portable
► Platform independent
► Secured
► Robust
► Architecture neutral
► Interpreted
► High Performance
► Multithreaded
► Distributed
► Dynamic
JAVA BUZZWORDS / FEATURES
Simple
● Java is designed to be easy for beginners and professional programmers to learn and use
effectively.
● It’s simple and easy to learn if you already know the basic concepts of Object-Oriented
Programming using C++ , since java syntax is C++ based
● Java has removed many complicated and rarely-used features, such as explicit pointers and
operator overloading.
● There is no need to remove unreferenced objects because there is an Automatic Garbage
Collection in Java
JAVA BUZZWORDS / FEATURES

Object-Oriented
● Everything in Java revolves around objects and classes.
● Java allows you to model real-world entities (like a car or a bank account) as objects in your
program, making it easier to manage and build complex applications.
● Key Object-Oriented Programming (OOP) concepts include:
○ Object: An instance of a class.
○ Class: A blueprint for creating objects.
○ Inheritance: Allows one class to inherit the properties of another.
○ Polymorphism: The ability of objects to take on multiple forms.
○ Abstraction: Hides the complex details and shows only the essentials.
○ Encapsulation: Keeps the data safe by restricting access to it.
JAVA BUZZWORDS / FEATURES
Distributed
● Java is designed to create distributed applications on networks.
● Java applications can access remote objects on the Internet as easily as they can do in the local
system.
● Java enables multiple programmers at multiple remote locations to collaborate and work together on
a single project.

Compiled and Interpreted


● Java combines both compiled and interpreted approaches, making it a two-stage
system.
● Compiled: Java compiles programs into an intermediate representation called Java
Bytecode.
● Interpreted: Bytecode is then interpreted, generating machine code that can be
directly executed by the machine that provides a JVM.
JAVA BUZZWORDS / FEATURES
Platform Independent
● Java is platform independent because it is different from other languages like C, C++, etc. which
are compiled into platform specific machines
● while Java is a write once, run anywhere language.
● A platform is the hardware or software environment in which a program runs.

Robust
● Java provides many features that make programs execute reliably in a variety of environments.
● Java is a strictly typed language that checks code at compile time and runtime.
● Java handles memory management with garbage collection and captures serious errors through
exception handling.
JAVA BUZZWORDS / FEATURES
Secure
● Java does not use pointers, which helps prevent unauthorized memory access.
● The JVM verifies Java bytecode before execution, ensuring that it adheres to Java’s
security constraints.
● Java applications run in a restricted environment (sandbox) that limits their access to
system resources and user data, enhancing security.

Architecture-Neutral
● Java language and JVM help achieve the goal of “write once; run anywhere, any time,
forever.”
● Changes and upgrades in operating systems, processors, and system resources do not force
any changes in Java programs.
JAVA BUZZWORDS / FEATURES
Portable
● Java provides a way to download programs dynamically to various types of platforms connected to
the Internet.
● Java is portable because of the JVM, which provides a consistent runtime environment across
different platforms.

High Performance
● Java performance is high because of the use of bytecode.
● The bytecode can be easily translated into native machine code.
JAVA BUZZWORDS / FEATURES
Multithreaded
● Multithreaded programs handle multiple tasks simultaneously, which is helpful in creating
interactive, networked programs.
● Java run-time system supports multiprocess synchronization for constructing interactive systems.

Dynamic
● Java can link in new class libraries, methods, and objects dynamically.
● Java programs carry substantial amounts of run-time type information, enabling dynamic linking in
a safe and expedient manner.
JDK
JDK(Java Development Kit)
► The JDK is the cornerstone for any Java developer, providing the essential tools needed to develop
Java applications and applets.
► It includes the JRE for running the Java applications you've developed, along with an assortment of
development tools such as a compiler (javac), an archiver (jar), and a documentation generator
(Javadoc), among others.
► The JDK allows developers to write Java programs and convert them into a format that can be
executed by the JRE and JVM.

Key Features of JDK:


Compiler (javac): Transforms your Java code into bytecode.
JavaDoc: Generates documentation from code comments.
Debugger: Helps in fixing errors in your code efficiently.
JRE - JAVA RUNTIME ENVIRONMENT
► JRE is a software package that allows Java programs to run on a computer.
► It's a collection of tools that include a virtual machine, libraries, and other resources.
► However, it doesn't include development tools like compilers or debuggers.
► It's a part of the JDK but can also be distributed separately to run Java applications.
► Its acts as a translator between the Java program and the operating system.
► It provides a secure environment for Java programs, preventing unauthorized access to system
resources.

What's in the JRE?


 Java Virtual Machine (JVM): The engine that runs Java applications.
 Core libraries: Provide essential functionalities to Java applications.
JVM - JAVA VIRTUAL MACHINE
► It's a virtual machine that allows Java bytecode to run and acts as an interpreter between the Java
programming language and the hardware.
► The JVM compiles bytecode into machine code so the CPU can execute the program
► The JVM provides a runtime environment for Java applications to run on different operating systems
and platforms
► The JVM uses a garbage collector to automatically manage memory
► The JVM allows new classes to be loaded at runtime

JVM's Roles:
 Loads code: Reads the compiled bytecode from the file system.
 Verifies code: Ensures the code is properly formatted and secure to execute.
 Executes code: Translates bytecode into machine language.
DATA TYPES
Data types specify the different sizes and values that can be stored in the variable. There are two types of
data types in Java
1. Primitive data types: The primitive data types include boolean, char, byte, short, int, long, float and
double.

2. Non-primitive data types: The non-primitive data types include Classes, Interfaces, and Arrays.
PRIMITIVE DATA TYPES
boolean
► The boolean data type represents a logical value that can be either true or false.
► Conceptually, it represents a single bit of information, but the actual size used by the virtual
machine is implementation-dependent and typically at least one byte (eight bits) in practice.
► Values of the boolean type are not implicitly or explicitly converted to any other type using casts.
► However, programmers can write conversion code if needed.
Syntax:
boolean booleanVar=false;
Size : Virtual machine dependent (typically 1 byte, 8 bits)
range of values : true or false
PRIMITIVE DATA TYPES
byte
► Its an 8-bit signed two's complement integer.
► It has a range of values from -128 to 127. Its default value is 0.
► The byte data type is commonly used when working with raw binary data or when memory
conservation is a concern, as it occupies less memory than larger integer types like int or long
Syntax:
byte a=10;
Size : Virtual machine dependent (typically 1 byte, 8 bits)
range of values : -128 to 127
PRIMITIVE DATA TYPES
short
The short data type is a 16-bit signed two’s complement integer. Similar to byte, a short is used when memory savings matter,
especially in large arrays where space is constrained.
Syntax:
short shortVar = 128;
Size : 2 bytes (16 bits)
Range of Values : -32,768 to 32,767.
int
It is a 32-bit signed two’s complement integer.
Syntax:
int intVar = 32768;
Size : 4 bytes ( 32 bits )
Range of Values : -2,147,483,648 to 2,147,483,647
PRIMITIVE DATA TYPES
long
The long data type is a 64-bit signed two’s complement integer. It is used when an int is not large
enough to hold a value, offering a much broader range.
Syntax:
long longVar = 100000L;
Size : 8 bytes (64 bits)
Range of Values : -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
float
The float data type is a single-precision 32-bit IEEE 754 floating-point. Use a float (instead of
double) if you need to save memory in large arrays of floating-point numbers. The size of the float
data type is 4 bytes (32 bits) , upto 7 decimal point precision.
Syntax:
float floatVar= 234.5f;
Size : 4 bytes (32 bits)
Precision : upto 7 decimal point
PRIMITIVE DATA TYPES
double

The double data type is a double-precision 64-bit IEEE 754 floating-point. For decimal values, this
data type is generally the default choice. The size of the double data type is 8 bytes or 64 bits.
Syntax:
double doubleVar= 12.3 ;
Size : 8 bytes (64 bits)
Precision : upto 15-16 decimal points

char

The char data type is a single 16-bit Unicode character with the size of 2 bytes (16 bits).
Syntax:
char charVar=‘A’;
Size : 2 bytes (16 bits)
EXAMPLE
class Tpdatatypes
{
public static void main(String args[])
{
char a = 'G';
int i = 89;
byte b = 4;
short s = 56;
double d = 4.355453532;
float f = 4.7333434f;
long l = 12121;
EXAMPLE
System.out.println("char: " + a);
System.out.println("integer: " + i);
System.out.println("byte: " + b);
System.out.println("short: " + s);
System.out.println("float: " + f);
System.out.println("double: " + d);
System.out.println("long: " + l);
}
}
► Execute and Check output
NON-PRIMITIVE (REFERENCE) DATA
TYPES
The Non-Primitive (Reference) Data Types will contain a memory address of variable values
because the reference types won’t store the variable value directly in memory. They are strings,
objects, arrays, etc.

Strings

Strings are defined as an array of characters. The difference between a character array and a
string in Java is, that the string is designed to hold a sequence of characters in a single variable
whereas, a character array is a collection of separate char-type entities. Unlike C/C++, Java
strings are not terminated with a null character.
Syntax: Declaring a string
<String_Type> <string_variable> = “<sequence_of_string>”;
Example : String s = “string-1”;
NON-PRIMITIVE (REFERENCE) DATA TYPES

Arrays
Arrays are a fundamental non-primitive data type in Java that allow you to store multiple values of the same
type in a single variable.
Arrays have a fixed size, which is specified when the array is created, and can be accessed using an index.
Arrays are commonly used to store lists of values or to represent matrices and other multi-dimensional data
structures.
Example :
String [] strArray = {“Java” , “oops” , “program”}
int[] numbers = new int[5];
int[] arr = { 1, 2, 3, 4, 5 };
Int b = arr[0]; // b will have value 1
JAVA VARIABLES

Variables are the containers for storing the data values or you can also call it a memory location name for
the data. Every variable has a:

● Data Type – The kind of data that it can hold. For example, int, string, float, char, etc.
● Variable Name – To identify the variable uniquely within the scope.
● Value – The data assigned to the variable.

There are three types of variables in Java – Local, Instance, and Static.
Example:
int age = 27; // integer variable having value 27
Static String name = "gfg“ // Static string variable
HOW TO DECLARE JAVA VARIABLES?

datatype: In Java, a data type define the type of data that a variable can hold.
data_name: Name was given to the variable.

In this way, a name can only be given to a memory location. It can be assigned values in two ways:

● Variable Initialization
● Assigning value by taking input

How to Initialize Java Variables?


It can be perceived with the help of 3 components explained above:
TYPES OF JAVA VARIABLES
Now let us discuss different types of variables which are listed as follows:

1. Local Variables
2. Instance Variables
3. Static Variables
LOCAL VARIABLES
A variable defined within a block or method or constructor is called a local variable.

● The Local variable is created at the time of declaration and destroyed after exiting from the block
or when the call returns from the function.
● The scope of these variables exists only within the block in which the variables are declared, i.e.,
we can access these variables only within that block.
● Initialization of the local variable is mandatory before using it in the defined scope
// Java Program to show the use of local variables
import java.io.*;

class Varclass{
public static void main(String[] args)
{
// Declared a Local Variable
int var = 10;

// This variable is local to this main method only


System.out.println("Local Variable: " + var);
}
}
INSTANCE VARIABLES
Instance variables are non-static variables and are declared in a class outside of any method, constructor,
or block.

● As instance variables are declared in a class, these variables are created when an object of the
class is created and destroyed when the object is destroyed.
● Unlike local variables, we may use access specifiers for instance variables. If we do not specify
any access specifier, then the default access specifier will be used.
● Initialization of an instance variable is not mandatory. Its default value is dependent on the data
type of variable. For String it is null, for float it is 0.0f, for int it is 0, for Wrapper classes like
Integer it is null, etc.
STATIC VARIABLES
Static variables are also known as class variables.

● These variables are declared similarly to instance variables. The difference is that static
variables are declared using the static keyword within a class outside of any method,
constructor, or block.
● Unlike instance variables, we can only have one copy of a static variable per class, irrespective
of how many objects we create.
● Static variables are created at the start of program execution and destroyed automatically when
execution ends.
● Initialization of a static variable is not mandatory. Its default value is dependent on the data
type of variable. For String it is null, for float it is 0.0f, for int it is 0, for Wrapper classes like
Integer it is null, etc.
JAVA CONSTANT
► As the name suggests, a constant is an entity in programming that is immutable.
► In other words, the value that cannot be changed. Usually, to accomplish this, the variable is
declared using the final keyword.
► Constants are frequently used to represent stable values, like mathematical constants, configuration
settings, or flag values, that do not change while a program is running.
► A variable's value is guaranteed to stay constant and unintentionally changed if it is declared as a
constant.
What is constant?
► Constant is a value that cannot be changed after assigning it.
► Java does not directly support the constants. There is an alternative way to define the constants in
Java by using the non-access modifiers static and final.
How to declare constant in Java?
► In Java, to declare any variable as constant, we use static and final modifiers.
► It is also known as non-access modifiers.
► According to the Java naming convention the identifier name must be in capital letters.

Syntax : final float PI = 3.14f;

► The above statement declares the float variable "PI" as a constant with a value of 3.14f.
► We cannot change the value of "PI" at any point in time in the program.
► Later if we try to do that by using a statement like "PI=5.25f", Java will throw errors at
compile time itself.
► It is not mandatory that we need to assign values of constants during initialization
JAVA OPERATORS
Java operators are special symbols that perform operations on variables or values. They can be classified
into several categories based on their functionality. These operators play a crucial role in performing
arithmetic, logical, relational, and bitwise operations etc.
Types of Operators in Java
1. Arithmetic Operators
2. Unary Operators
3. Assignment Operator
4. Relational Operators
5. Logical Operators
6. Ternary Operator
7. Bitwise Operators
8. Shift Operators
9. instance of operator
ARITHMETIC OPERATORS
Arithmetic Operators are used to perform simple arithmetic operations on primitive and non-primitive
data types.

● * : Multiplication
● / : Division
● % : Modulo
● + : Addition
● – : Subtraction
UNARY OPERATORS
Unary Operators need only one operand. They are used to increment, decrement, or negate a value.

● - , Negates the value.


● + , Indicates a positive value (automatically converts byte, char, or short to int).
● ++ , Increments by 1.
○ Post-Increment: Uses value first, then increments. Eg : a=10; a++;
○ Pre-Increment: Increments first, then uses value. Eg; b=5; ++b;
● -- , Decrements by 1.
○ Post-Decrement: Uses value first, then decrements. Eg : a=10; a--;
○ Pre-Decrement: Decrements first, then uses value. Eg : --a;
● ! , Inverts a boolean value. Eg : boolean valid=true; !valid will be false.
EXAMPLE- NOT OPERATOR
EXAMPLE - UNARY OPERATOR
//

import java.io.*;

class Unop {
public static void main(String[] args)
{
int n1 = 20;
System.out.println("Number = " + n1);

n1 = -n1;

// Printing the above result number


// after unary operation
System.out.println("Result = " + n1);
}
EXAMPLE - INCREMENT &
DECREMENT OPERATOR
RELATIONAL OPERATORS
Relational Operators are used to check for relations like equality, greater than, and less than. They
return boolean results after the comparison and are extensively used in looping statements as well
as conditional if-else statements. The general format is ,
variable relation_operator value

Relational operators compare values and return boolean results:

● == , Equal to.
● != , Not equal to.
● < , Less than.
● <= , Less than or equal to.
● > , Greater than.
● >= , Greater than or equal to.
EXAMPLE – RELATIONAL
OPERATOR CODE
LOGICAL OPERATORS
Logical Operators are used to perform “logical AND” and “logical OR” operations, similar to AND gate
and OR gate in digital electronics. They have a short-circuiting effect, meaning the second condition is
not evaluated if the first is false.
Conditional operators are:

● &&, Logical AND: returns true when both conditions are true.
● ||, Logical OR: returns true if at least one condition is true.
● !, Logical NOT: returns true when a condition is false and vice-versa
import java.io.*;

class Logicoperator {

public static void main (String[] args) {

boolean x = true;
boolean y = false;

System.out.println("x && y: " + (x && y));


System.out.println("x || y: " + (x || y));
System.out.println("!x: " + (!x));
}
}
BITWISE OPERATORS
JAVA CONTROL STATEMENTS | CONTROL FLOW
IN JAVA

► Java compiler executes the code from top to bottom.


► The statements in the code are executed according to the order in which they appear.
► However, Java provides statements that can be used to control the flow of Java code. Such
statements are called control flow statements.
► It is one of the fundamental features of Java, which provides a smooth flow of program.
JAVA CONTROL STATEMENTS |
CONTROL FLOW IN JAVA
Java provides three types of control flow statements.
1. Decision Making statements
○ if statements
○ switch statement
2. Loop statements
○ do while loop
○ while loop
○ for loop
○ for-each loop
3. Jump statements
o break statement
○ continue statement
IF STATEMENT
if statement to specify a block of Java code to be executed if a condition is true.

Syntax
if (condition) {
// block of code to be executed if the condition is true
}
THE ELSE STATEMENT

the else statement to specify a block of code to be executed if the condition is false.

Syntax
if (condition) {
// block of code to be executed if the condition is true
} else {
// block of code to be executed if the condition is false
}
ELSE IF STATEMENT

the else if statement to specify a new condition if the first condition is false.
Syntax
if (condition1) {
// block of code to be executed if condition1 is true
} else if (condition2) {
// block of code to be executed if the condition1 is false and condition2 is true
} else {
// block of code to be executed if the condition1 is false and condition2 is false
}
SWITCH STATEMENTS
Instead of writing many if..else statements, you can use the switch
statement.
The switch statement selects one of many code blocks to be executed:
Syntax
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
BREAK AND DEFAULT KEYWORD
When Java reaches a break keyword, it breaks out of the switch block.
This will stop the execution of more code and case testing inside the block.
When a match is found, and the job is done, it's time for a break. There is no need for more testing.
A break can save a lot of execution time because it "ignores" the execution of all the rest of the code in
the switch block.
The default keyword specifies some code to run if there is no case match
Note that if the default statement is used as the last statement in a switch block, it does not need a break.
LOOPS
Java While Loop
The while loop loops through a block of code as long as a specified condition is true:

Syntax
while (condition) {
// code block to be executed
}
DO/WHILE LOOP

The do/while loop is a variant of the while loop. This loop will execute the code block once, before
checking if the condition is true, then it will repeat the loop as long as the condition is true.

Syntaxdo {
// code block to be executed
}
while (condition);
FOR LOOP

When you know exactly how many times you want to loop through a block of code, use the for loop
instead of a while loop:

Syntax
for (statement 1; statement 2; statement 3) {
// code block to be executed
}
NESTED FOR LOOPS

It is also possible to place a loop inside another loop. This is called a nested loop.
The "inner loop" will be executed one time for each iteration of the "outer loop":
Example
// Outer loop
for (int i = 1; i <= 2; i++) {
System.out.println("Outer: " + i); // Executes 2 times

// Inner loop
for (int j = 1; j <= 3; j++) {
System.out.println(" Inner: " + j); // Executes 6 times (2 * 3)
}
}
BREAK STATEMENT
Java Break
You have already seen the break statement used in an earlier chapter of this tutorial. It was used to
"jump out" of a switch statement.
The break statement can also be used to jump out of a loop.
This example stops the loop when i is equal to 4:

Example
for (int i = 0; i < 10; i++) {
if (i == 4) {
break;
}
System.out.println(i);
}
CONTINUE
Java Continue

The continue statement breaks one iteration (in the loop), if a specified condition
occurs, and continues with the next iteration in the loop.
This example skips the value of 4:

Example
for (int i = 0; i < 10; i++) {
if (i == 4) {
continue;
}
System.out.println(i);
}
Program to demonstrate
► Simple java class
► Data Types
► Variables
► Control statements
► Loops/collection

You might also like