ASSIGNMENT-1 As there was growth of multiple incompatible hardware

                           ASSIGNMENT-1

                             ( JAVA
WHITE PAPER)

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

 

In the past it has been very difficult for a
software developer to make, job as programmer easy and efficient. As there was
growth of multiple incompatible hardware architecture, each supporting multiple
incompatible operating systems with each platform having a different graphical
user interface.

To cope up with this kind of situation a better
solution came up which was called JAVA.

But

What were the paramount challenges that JAVA had to
meet with?

Some paramount challenges that JAVA need to meet up
where, Security of the applications, and that these applications should consume
minimum amount of resources,

Secondly, the applications should be able to run on
any hardware or software platform, and can be extended dynamically.

To overcome these challenges some goals were
designed for the applications-

DESIGN GOALS OF JAVA

1.    Security

2.    High
performance

Robust applications
that should be able to run on multiple platforms in distributed networks.

Characteristics
of Java:-

1.     Simple

 

From
java being simple, we mean that that it is a language which does not require
any kind of professional learning to use it.

 

Object
Oriented

It is said that java is
object oriented language, what it means that through this language we can
combine data structures with functions to create re-usable objects.

2.     Familiar

Java is familiar, as in
the programmers who used to work on C++ language can easily migrate to java and
be productive quickly.

3.     Robust and Secure

Java is a robust
language as it provides a very quick compile-time checking. It interprets the
code line-by-line while we are writing the code. It also has the concept of no
pointers or pointer arithmetic.

Java is designed in
such a way that the applications that we develop in this, are very secure at
large or extensive level.

4.     Architecture Neutral and Portable

Java is made to be
architectural neutral because it was constructed to support the applications
that will be deployed into heterogenous networked environments. So, in such
environments it is necessary that the applications is able to run on any kind
of hardware architecture, apart from this it should also be execute on all
sorts of operating systems.

                     For
this to happen java generates bytecodes- which is an

                     architecture
neutral intermediate formatted constructed to transfer

               
    code efficiently to multiple hardware and
software platforms.

 

                   If java is architecture
neutral, that it automatically becomes a  

                    portable language.

                    The environment created by
these characteristics is called as Java    

               
    Virtual Machine.

 

5.     High Performance

 

Java is having high
performance capability because there is an automatic garbage collector, which
disposes off the waste memory, by allocating to that part which is in need of
it, leading to better performance.

6.    
Interpreted,
Threaded, and Dynamic

 

                    Java is an interpreted
language which means that we don’t need to  

                
   run the long cycles of- compile, link and
test the code. This leads to

                
  the faster development cycles
that is- prototyping, experimentation,   

                   and rapid development.

                 

                  Java is threaded which means
it provide multi-threading capabilities

                  to the programmer to create
applications with many concurrent

                
 threads of activity, which
results paramount interactivity with the

                
 end user.

 

                  From java being dynamic we mean that when
java compiles the     

                  code, at that run-time is
dynamic, meaning the linking process or

                  stages are dynamic. We can
add new modules on demand from

                  variety of sources. Interactive
code can be loaded from anywhere.

 

 

                JAVA
BASE SYSTEM

 

               Java provides various kinds of libraries which
contains methods and classes that a developer can use to create multi-platform
applications.

Some
of these libraries are –

1.      java.lang

2.      java.io

3.      java.util

4.      java.awt

 

      Till now we talked about how java is
beneficial for programming and what are were its characteristics. Now we will
learn how Java is different from C and C++ and what are its essential features.

 

Everything
in Java is object apart from the primitive data types.

 

Primitive data types

1.     Numeric
data types

·       
 Integer
numeric data type-

8-
bit byte, 16-bit short, 32- bit int, 64- bit long

·       
No unsigned type specifier for integer
data types in java.

·       
Real numeric types are 32-bit float, 64
bit- double.

 

2.     Character
Data Types

·       
char data type in java defines 16-bit Unicode
character.

·       
Unicode character are unsigned 16-bit
values.

·       
Range 0 through 65,535.

 

3.     Boolean
data types

·       
This data type is new for the
programmers as it has been added to java as primitive data type

·       
Keywords used are –TRUE and FALSE or YES
and No.

·       
Can’t be converted to any numeric type.

 

Operators

 

1.     Arithmetic
operators

2.     Relational
operators

3.     >>>
 new operator is added which defines
right shift.

4.     Java
use + operator for concatenation two or more strings.

 

Arrays

Arrays
in java are objects which is having a run-time representation.

 Declaring an array in java——-

 

Abc
abcd;           (abc here is class, and
abcd is array)

 

Allocating
storage to array——

 

abcd=
new abcd5;

 

now
allocating the values is done in the similar way , as it is done in C language.

 

Strings

 

Strings
here in java are objects not pseudo arrays as in C language.

There
are two types of String objects, first are those which are read only objects,
namely String class, and second for those objects which we wish to modify,
namely StringBuffer.

Characters
which are enclosed in double quotes are strings.

 

Also
java uses + (concatenation operator) in an extensive way

Eg-System.out.println(“My
age is”+age);

 

Multi-Level Break

 

To
break or continue multiple-nested loop or switch cases java is not having goto statement
but, it has break and continue statement instead.

 

But
here function of continue is different as it used to be in C language. Here the
continue statement passes control to the outer for statement, or we can say the
next iteration of the loop.

 

Memory Management and Garbage Collection

In
C and C++ it was very difficult to manage the memory as, the programmer as to
free up the memory all by itself.

But,
Java is having a very good memory management model which is based on objects
and references to objects.

As
there are pointers used in java, so the only reference is done to the object.

When
an object has no more in use, then a new operator “Automatic Garbage collector”
which is an integral part of java, free up the memory.

 

This
garbage collector increase its performance by keeping in check the behaviour of
the user while interacting with the softwares. It sees that for what time it is
taking pauses while proceeding further, seeing this behaviour it gathers and
compacts unused memory, and increases the portability of resources available.

 

Integrated Thread Synchronization

Multithreading
is supported by java may it be language level or may via the support from its
run-time environment system and thread objects. It provides ease to the
programmer for constructing thread-safe multithreaded classes.

 

 

Now
let us study the features that are not present in Java, but where there in

 

C

C++

Java

Typedefs,
defines or preprocessors

YES

YES

NO

Structues
or unions

YES

YES

NO,
structure or unions present as complex data type

Classes

NO,
as there where structures

NO, as there where structures

YES

Multiple
Inheritance

YES

YES

NO,
as here use of interfaces serve the purpose of multiple inheritance.

Goto
statements

YES

YES

NO

Operator
Overloading

YES

YES

NO

Pointers

YES

YES

NO,
as java uses objects and arrays of objects.