Characteristic of Java
Characteristic of Java
CHARACTERISTICS OF JAVA
I'm sure that you have eared a lot of things about Java™. Here you have a b
rief relaction of some of this things. Some of the characteristics that we descr
ibe here, were extracted from a White Paper where the Java™ developers exp
lains their desing goals and accomplishments. In spite of that paper is organiz
ed along eleven buzzwords, we make reference here to only six of that buzzw
ords. Here you have the relaction of them :
Simple Portable
Robust Multithreaded
Secure Dynamic
Architecture Neutral
3.1.DESCRIPTION OF FEATURES
Java™ is simple
Java™ is robust
Java is intended for writing programs that must be reliable in a variety of way
s. Java puts a lot of emphasis on early checking for possible problems, later d
ynamic (run-time) checking, and eliminating situations that are error-prone....
The single biggest difference between Java and C/C++ is that Java has a poin
ter model that eliminates the possibility of overwriting memory and corruptin
g data.
Maybe you don't know yet how is the Object-Oriented Programming and may
be you are worried for this. Don't worry. You probably know already the struct
ured programming. If you think a bit about the model of structured programm
ing, you'll see that it's not the same model that we use naturally to organize t
he information in our sense. The OOP (Object-Oriented Programming) tries to
use in programming, the same model which our sense uses. So, you will learn
rapidly how to use this way of programming.
The OOP has only one difficulty: you have to learn some new concept based i
n a special object-oriented terminology. So, you will ear words like object, cla
ss, instance... and you will ear that OOP has based on three major properties:
encapsulation, polymorphism and inheritance. You will learn more about this
along this tutorial.
... The Java interpreter can execute Java bytecodes directly on any machine t
o which the interpreter has been ported. Since linking is a more incremental a
nd lightweight process, the development process can be much more rapid an
d exploratory...
Using the compiler, you translate the source code of a program into an interp
reted language called Java bytecodes.
Using the interpreter of the Java platform, you can finally execute this progra
m.
The difference between Java™ and other languages which allows Java™ to be
portable is in that first step and in that bytecodes. The bytecodes can be inter
preted on the Java platform of a any one computer. When you find, for examp
le, a Java™ applet on a web page, you are downloading a bytecode file that t
he Java Virtual Machine (JVM), which is installed on your computer, is executi
ng.
Java™ is secure
Here you have some points which tries to guarantee the applets security in Ja
va:
Language and compiler : All the references to memory are symbolic referenc
es (you can't know where in the memory will stay your program, it only depe
nds of the JVM and of each machine).
Bytecodes checker : On the Java Virtual Machine the bytecodes code is check
ed to confirm that it was compiled on an standard compiler.
Classes loader : Each applet is loaded on its own memory space, to make imp
ossible the information interchange between applets.
Java™ is multithreaded
A good way to prevent your Java programs from locking up is to use multithre
ading, which simply means you write a program that enables multiple executi
on streams to occur simultaneously within the same program
Using multiple threads in Java programs is far easier than in C or C++ becaus
e of the language-level support offered by the Java programming language.
Most people thinks that Java™ and JavaScript are the same thing, but they
are wronged. See here what are the differences between these two language
s:
JavaScript Java
Code integrated with, and embedded in, HTML. Applets distinct from HTML (a
ccesed from HTML pages).
Variable data types not declared (loose typing). Variable data types must be
declared (strong typing).
...The single biggest difference between Java and C/C++ is that Java has a poi
nter model that eliminates the possibility of overwriting memory and corrupti
ng data...
In a first contact, Java™ seems like C++, and it's logical because how we hav
e said Java™ takes the C and C++ syntax. Java™ have nevertheless some im
portant differences with C++. For instance, you can't use pointers in Java™, n
either operators overload, neither multiple inheritance, neither predefined typ
es. These features of C++ that Java doesn't has, make it a simplest and more
robust language. Interpreted Java™ is furthermore slowly than C++ (even 20
to 50 times slower than C in the original Java interpreters).
Memory administration:
Tipe of data:
Primitive Java data (like char, int, long...) have sizes and behaviors which con
sist in some platforms and operative systems. In Java language, don't exist u
nsigned data.
The boolean data has two values in Java : true and false. So it isn't an integer
type, but you can force "0" and "1" (which are integers) to be booleans.
Operators:
The execution order of the operators is the same as in C. But, for example, th
e special word new (to create a new object) is linked in a more narrow form t
han point notation (.), which has another behavior in C++.
Flux Control:
The syntax of the following statements if, while, for and do is the same as in
C and C++. But there is an important difference : the proof expression for ea
ch flux construction should return a boolean value (true or false). In C and C+
+, the expression can return an integer.
Arguments:
The arguments in the command line have a different behavior than in C and
C++. So, in this languages argv[0] is the name of the program but in Java thi
s is the first of additionals arguments.