Vous êtes sur la page 1sur 18

Ê   

‘
‘


The concept of Write-once-run-anywhere (known as the Platform independent) is one of the
important key feature of java language that makes java as the most powerful language. Not
even a single language is idle to this feature but java is more closer to this feature. The
programs written on one platform can run on any platform provided the platform must have
the JVM.
  ‘
There are various features that makes the java as a simple language. Programs are easy to
write and debug because java does not use the pointers explicitly. It is much harder to write
the java programs that can crash the system but we can not say about the other programming
languages. Java provides the bug free system due to the strong memory management. It also
has the automatic memory allocation and deallocation system.
 ‘ 
‘
To be an Object Oriented language, any language must follow at least the four characteristics.

’‘ Inheritance : It is the process of creating the new classes and using the behavior
of the existing classes by extending them just to reuse the existing
code and adding the additional features as needed.
’‘ Gncapsulation: : It is the mechanism of combining the information and providing
the abstraction.
’‘ Polymorphism: : As the name suggest one name multiple form, Polymorphism is
the way of providing the different functionality by the
functions having the same name based on the signatures of the
methods.
’‘ uynamic binding : Sometimes we don't have the knowledge of objects about their
specific types while writing our code. It is the way of providing the
maximum functionality to a program about the specific type at runtime.

As the languages like Objective C, C++ fulfills the above four characteristics yet they are not
fully object oriented languages because they are structured as well as object oriented
languages. But in case of java, it is a fully Object Oriented language because object is at the
outer most level of data structure in java. No stand alone methods, constants, and variables are
there in java. Gverything in java is object even the primitive data types can also be converted
into object by using the wrapper class.
è‘
Java has the strong memory allocation and automatic garbage collection mechanism. It
provides the powerful exception handling and type checking mechanism as compare to other
programming languages. Compiler checks the program whether there any error and interpreter
checks any run time error and makes the system secure from crash. All of the above features
makes the java language robust.

c
u
‘
The widely used protocols like HTTP and FTP are developed in java. Internet programmers
can call functions on these protocols and can get access the files from any remote machine on
the internet rather than writing codes on their local system.
 ‘
The feature Write-once-run-anywhere makes the java language portable provided that the
system must have interpreter for the JVM. Java also have the standard data size irrespective of
operating system or the processor. These features makes the java as a portable language.
u ‘
While executing the java program the user can get the required files dynamically from a local
drive or from a computer thousands of miles away from the user just by connecting with the
Internet.
 ‘
Java does not use memory pointers explicitly. All the programs in java are run under an area
known as the sand box. Security manager determines the accessibility options of a class like
reading and writing a file to the local disk. Java uses the public key encryption system to allow
the java applications to transmit over the internet in the secure encrypted form. The bytecode
Verifier checks the classes after loading.
  ‘
Java uses native code usage, and lightweight process called threads. In the beginning
interpretation of bytecode resulted the performance slow but the advance version of JVM uses
the adaptive and just in time compilation technique that improves the performance.
 

As we all know several features of Java like Secure, Robust, Portable, dynamic etc; you will
be more delighted to know another feature of Java which is  


Java is also a Multithreaded programming language. Multithreading means a single program
having different threads executing independently at the same time. Multiple threads execute
instructions according to the program code in a process or a program. Multithreading works
the similar way as multiple processes run on one computer.
Multithreading programming is a very interesting concept in Java. In multithreaded programs
not even a single thread disturbs the execution of other thread. Threads are obtained from the
pool of available ready to run threads and they run on the system CPUs. This is how
Multithreading works in Java which you will soon come to know in details in later chapters.
    
‘
We all know that Java is an interpreted language as well. With an interpreted language such as
Java, programs run directly from the source code.
The interpreter program reads the source code and translates it on the fly into computations.
Thus, Java as an interpreted language depends on an interpreter program.
The versatility of being ‘

‘makes Java to outshine from other languages.
The source code to be written and distributed is platform independent.
Another advantage of Java as an interpreted language is its error debugging quality. uue to
this any error occurring in the program gets traced. This is how it is different to work with
Java.

ÿ
^  ‘ ‘
The term architectural neutral seems to be weird, but yes Java is an architectural neutral
language as well. The growing popularity of networks makes developers think distributed. In
the world of network it is essential that the applications must be able to migrate easily to
different computer systems. Not only to computer systems but to a wide variety of hardware
architecture and Operating system architectures as well. The Java compiler does this by
generating byte code instructions, to be easily interpreted on any machine and to be easily
translated into native machine code on the fly.‘The compiler generates an architecture-neutral
object file format to enable a Java application to execute anywhere on the network and then
the compiled code is executed on many processors, given the presence of the Java runtime
system.‘Hence Java was designed to support applications on network. This feature of Java has
thrived the programming language.

‰
•  
  
  

Y ‘
‘ ‘ ‘ ‘
‘ ‘  
‘  ‘‘

‘‘ ‘  


‘•  
  
  ‘ ‘•
  ‘ ‘
 ‘   ‘  ‘‘ ‘ ‘ ‘‘ ‘ ‘ ‘‘
 ‘ ‘ ‘ ‘ ‘ ‘ ‘ ‘ ‘   ‘   ‘ ‘‘ ‘
 ‘  ‘ ‘ ‘    
‘   
‘ ‘    ‘ ‘ ‘ ‘ ‘ ‘
   ‘ ‘ ‘‘  ‘ ‘ ‘‘   ‘‘ ‘ ‘ ‘
 ‘‘ ‘  ‘‘ ‘ ‘!"‘ ‘‘  ‘ ‘!"‘
‘ ‘ ‘ ‘   ‘  ‘‘ 
‘  ‘ 
‘
‘ ‘  ‘ ‘
‘  ‘ ‘ ‘  ‘ ‘‘
 ‘ ‘   ‘ ‘   ‘ ‘ 
‘ ‘ ‘# $
 $  #‘ ‘   ‘  ‘ ‘ ‘‘‘  ‘
 ‘‘  ‘ ‘‘ ‘% ‘& ‘‘ ‘&  $'(‘) ‘ ‘
"'*‘Y   ‘" ‘' ‘  ‘   ‘ ‘‘ ‘ $‘
  ‘  ‘‘ ‘‘!  ‘   
‘  ‘ ‘ ‘  ‘ ‘!"‘
‘  ‘ ‘ ‘ ‘ ‘  ‘    ‘‘
  ‘‘  + ‘ ‘ ‘‘‘ ‘"  ‘   ‘'  ‘"'
‘ ‘‘
‘  ‘ ‘  ‘   ‘  ‘ ‘ ‘ +‘

•    •

!"‘   ‘ ‘  ‘ ‘ ‘‘ ‘   ‘ ‘ ‘ ‘ ‘


  ‘ ‘ ‘ ‘‘‘ ‘ ‘ ‘ ‘  ‘ ‘ ‘
 ‘ ‘ ‘ ‘ ‘  ‘‘  ‘!"‘ ‘‘ ‘  ‘ ‘
 ‘ ‘

’‘ " ‘, 


‘ ‘ ‘ ‘‘ ‘ ‘ ‘  ‘
  ‘ ‘# ‘ ‘ ‘ #‘
’‘ " ‘   ‘  ‘$‘ ‘‘ ‘ ‘ ‘
 ‘‘ -  ‘ ‘ ‘   +‘
’‘ & ‘. ‘ ‘ ‘  ‘$‘ ‘‘ ‘
   ‘ ‘   ‘ ‘  ‘‘
’‘ & ‘ ‘ ‘‘  ‘$‘ ‘‘ ‘ ‘
‘  ‘ ‘  ‘  ‘

 
’‘ / ‘)‘
‘  ‘ ‘ ‘$‘ ‘‘ ‘
  ‘ ‘ ‘‘‘‘
’‘  ‘   ‘‘ ‘  ‘$‘ ‘‘ ‘
 ‘  ‘ ‘  ‘
’‘ 0 ‘   ‘‘ ‘  ‘$‘ ‘‘ ‘
  ‘ ‘  ‘ ‘  ‘ ‘ ‘ ‘
’‘   ‘ ‘‘ ‘  ‘$‘‘ ‘ ‘ ‘  ‘
 ‘  ‘ ‘  ‘ ‘
’‘ 1  . ‘  
‘  
‘  
‘   ‘
  
‘‘ ‘  ‘
’‘ 2   ‘  . ‘ ‘  ‘  
‘ ‘ ‘ ‘
 ‘ ‘  ‘ ‘
’‘ 0  ‘&  ‘$‘ ‘ ‘ ‘ ‘  ‘  ‘ ‘   ‘
 ‘ ‘ ‘ ‘ ‘  ‘ ‘

• 
   

‘  ‘ ‘  ‘ ‘ ‘ $   ‘


‘  ‘    ‘‘
‘ ‘‘ ‘ ‘ ‘ ‘ ‘  ‘ ‘ ‘
‘ ‘
 ‘  ‘  ‘ ‘ ‘ ‘ ‘‘ ‘‘ ‘ ‘ ‘ ‘
 ‘ ‘ ‘ ‘ ‘ ‘ ‘ ‘  ‘ ‘  ‘ ‘ ‘
 ‘ ‘  ‘"  ‘ ‘‘  ‘ ‘ ‘‘

’‘ " ‘ ‘$‘ ‘ ‘ ‘ ‘  ‘  ‘ ‘ ‘
  ‘ ‘ ‘
’‘ 3  ‘ ‘$‘ ‘ ‘ ‘‘ ‘ ‘‘ ‘ ‘ ‘
’‘    ‘$‘ ‘ ‘ ‘ ‘ ‘ ‘-‘ ‘   ‘
  ‘
’‘ )   ‘$‘ ‘ ‘ ‘ ‘    ‘ ‘‘ ‘
 ‘ ‘
’‘ )  + ‘$‘ ‘ ‘ ‘‘  ‘‘ ‘ ‘ ‘ ‘
‘  ‘ ‘
’‘  ‘ ‘$‘ ‘ ‘ ‘ ‘   ‘ ‘ ‘  ‘ ‘ ‘
‘  ‘ ‘

•      •  


  •  



 ‘  + ‘  ‘   ‘  ‘"'‘ ‘  ‘   ‘  ‘  ‘
"&'‘‘  ‘ ‘  ‘ ‘  
‘  ‘ ‘ ‘   ‘ ‘ ‘
 ‘ ‘  ‘ ‘  ‘ ‘ ‘
‘‘   ‘ ‘Y  ‘
 ‘ ‘,   ‘4 ‘0 ‘ ‘ ‘  ‘‘ ‘  
‘


  +
‘ 
‘ ‘  ‘ ‘   ‘ ‘ ‘ ‘‘‘‘
&  $'(‘ 
‘ ‘ ‘(  ‘ ‘  ‘ ‘   ‘ ‘

•        • 

 •

"'*‘‘ ‘ $ +‘   ‘ ‘ ‘  ‘  ‘ ‘!"‘ ‘


 ‘ ‘ ‘ ‘ ‘ ‘ ‘ ‘ ‘ ‘   ‘ ‘
‘‘ ‘  ‘‘ -  
‘  ‘‘ ‘‘ ‘‘ ‘
  ‘ ‘ ‘ ‘ ‘  ‘ ‘ ‘ ‘  ‘ ‘ ‘
   ‘‘ ‘



 ‘" ‘ ‘& ‘'  + ‘ ‘ ‘   ‘"‘"'&'‘


  ‘ ‘ ‘ ‘   ‘ ‘
   !  
‘  
‘

  
! 
‘   
 
 ‘ ‘ 
‘ ‘‘ ‘‘
‘ ‘ ‘  ‘   ‘  ‘ ‘ ‘ 5‘"'*‘ ‘ ‘
 ‘ ‘ ‘  ‘
‘ ‘ ‘   ‘3 ‘‘ ‘‘   $
‘‘  ‘ ‘ $  $‘‘ ‘ ‘ ‘ ‘"'&'‘ ‘‘
 +‘ ‘ ‘  + ‘  ‘ ‘ ‘ $ ‘
‘  ‘ ‘"'*‘
 ‘ $ ‘ ‘  ‘ ‘ ‘‘   ‘ ‘  ‘"'*‘  ‘
 ‘ ‘ ‘ ‘  +
‘ - ‘ ‘
‘ ‘ ‘
‘ ‘
  ‘ ‘  ‘

•
    " # 
$

&'6‘ - ‘ ‘  ‘( ‘ ‘  ‘   ‘  ‘ ‘‘ ‘ ‘
 ‘ ‘ ‘  ‘ ‘   ‘  ‘& ‘789‘ ‘ - ‘‘ ‘ ‘
  ‘ - ‘   ‘ ‘ ‘   ‘  ‘& ‘:8:‘0  ‘ ‘
&'6‘  ‘‘ ‘  ‘ ‘‘‘ 
‘ ‘ ‘ ‘   ‘
 ‘ ‘    ‘ ‘ ‘ ‘‘ ‘   ‘  ‘ ‘   ‘
 ‘ ‘& ‘:8:‘ ‘&'6‘

 ‘"'*‘   ‘ ‘‘‘ ‘  ‘  ‘&'6‘ 


‘   ‘"'*‘‘
 ‘  ‘‘‘ ‘988;‘&'6‘ ‘ ‘ ‘0")'*<=>‘ ‘&,"<9>‘
 ‘ ‘‘ ‘ ‘‘‘ ‘ ‘ ‘&'6‘:8:‘  ‘ ‘ ‘(  ‘ ‘
 ‘   ‘ ‘ ‘  
‘  ‘   ‘ ‘ ‘‘ ‘‘
 ‘ - ‘‘ ‘  ‘ ‘‘‘‘ ‘ ‘ ‘  ‘&'6‘
A
:8:‘ $ ‘ ‘  ‘‘  
‘&  ‘‘) ‘&  ‘?‘=8@‘
&)&=8@<7>‘‘ ‘‘ ‘ ‘ ‘ ‘  ‘ ‘ ‘   ‘  ‘
‘‘   ‘‘ ‘&'6‘ ‘

‘ ‘ ‘  ‘ ‘ ‘ ‘‘ ‘ ‘&'6‘:8:‘  ‘ ‘‘

’‘ & ‘  ‘   ‘ ‘ ‘  ‘ ‘  ‘
  ‘  ‘   ‘  ‘ ‘  ‘ ‘  ‘ ‘  ‘ ‘ ‘
 ‘  ‘  ‘‘  ‘   ‘ 
‘ ‘ ‘  ‘  
‘
  
‘ ‘
‘ ‘ ‘ ‘‘‘##‘ ‘ ‘ ‘  ‘
 ‘ 
‘ ‘‘ ‘  ‘  ‘
’‘ ‘ ‘ ‘ ‘ ‘ ‘  ‘ ‘  ‘  ‘ ‘
 ‘ ‘ ‘‘   ‘  ‘ ‘  
‘  ‘ ‘ ‘ ‘
  ‘ 5‘
’‘ ‘ ‘ 
‘  ‘ ‘ ‘ ‘  ‘ ‘ ‘  ‘
‘  ‘

& ‘   ‘ ‘ ‘ ‘ ‘ ‘ ‘  ‘ ‘ ‘‘ ‘ ‘
‘

’‘ %  ‘ ‘  + A‘   ‘ ‘  ‘ ‘ ‘   ‘


 ‘ ‘
’‘   ‘ ‘‘ ‘‘‘ ‘  
‘   + 
‘ 
‘
 + ‘ ‘  ‘ ‘   ‘ 5‘
’‘   ‘ ‘‘ ‘ ‘  ‘ ‘   ‘ 5‘
’‘ 2‘ ‘ ‘ ‘‘ ‘  ‘ ‘  ‘ ‘ ‘
  ‘ ‘  ‘ ‘  5‘
’‘ 2 ‘ ‘  ‘‘ 5‘
’‘ , ‘ ‘‘ ‘ ‘ ‘ ‘ 
‘ ‘ 
‘ ‘ ‘
 ‘ ‘‘   ‘ ‘ ‘   ‘  ‘ 5‘ ‘
’‘ B  ‘‘ ‘  ‘  ‘ ‘ ‘ ‘

‘‘  ‘&  $'(


‘  + ‘ ‘  ‘  ‘ ‘   ‘
 ‘ ‘  ‘ ‘ ‘‘ ‘ ‘  ‘ ‘  ‘  ‘  ‘ ‘
‘   ‘ ‘‘ ‘  ‘ ‘ ‘‘‘ ‘  
‘  + ‘
 ‘ +‘ ‘‘ ‘ ‘ ‘ ‘  ‘ ‘  ‘  ‘‘ ‘   ‘
 ‘ ‘Y ‘ 
‘‘  ‘ ‘ ‘ ‘ ‘ ‘
  ‘ ‘‘  ‘  ‘ ‘   ‘  ‘)‘ 
‘‘ ‘  ‘

‘( ‘  ‘ ‘  ‘ ‘  ‘  ‘ ‘ 
‘ ‘ ‘
  
‘  ‘ ‘ ‘ 
‘ ‘- ‘ 
‘ ‘‘ ‘  ‘
‘ ‘ ‘   ‘  ‘) ‘ ‘ ‘ ‘ ‘  ‘ ‘‘

†
 ‘ ‘‘ ‘ ‘   ‘  ‘ ‘  ‘ ‘ ‘‘ ‘ ‘
 ‘ ‘  + 
‘&  $'(‘ ‘‘ ‘‘ ‘ ‘ ‘
 ‘  ‘ ‘   ‘  ‘ ‘  ‘‘ ‘ ‘  ‘ ‘
   ‘   ‘ ‘ ‘ ‘‘ ‘ ‘   ‘ ‘   ‘ ‘
‘‘ ‘‘ ‘ ‘  ‘‘988;‘  ‘ ‘  ‘ ‘


 ‘  ‘ % 
 ‘

  "  ‘ ‘   ‘  ‘  ‘ ‘


&'(‘ )  "    ‘   ‘ ‘‘ ‘ ‘
 
 ) ‘  ‘ ‘ ‘",'‘ ‘"Y'‘  ‘   ‘

'  ‘ ‘ ‘ ‘ ‘  ‘


 ‘ ‘ ‘ ‘ ‘  ‘ ‘  ‘
+      ‘&'6‘& ‘:8:‘&  $'(‘) ‘& ‘
*'*‘    :8:‘  ‘ ‘ ‘$ ‘ ‘ ‘
•      ‘   ‘   ‘ ‘ ‘  ‘  ‘   ‘
 ‘ ‘ ‘
‘  ‘ ‘  ‘ ‘
 ‘ ‘  ‘ ‘ ‘  ‘  ‘

0‘ ‘ ‘‘ ‘‘  ‘


)   • 
*',‘   ‘ ‘ ‘ ‘‘  ‘ ‘ ‘   ‘
%
 ‘
  ‘ ‘ ‘  ‘ ‘   ‘ ‘

4- ‘‘ ‘ ‘  ‘‘  ‘


 ‘ ‘  ‘  
‘‘ ‘  ‘ ‘
  ‘ ‘ A‘  ‘ ‘   ‘‘
  .   
-'(‘     Y‘ ‘  ‘  ‘ ‘ ‘ ‘ ‘
%
 ‘  ‘ ‘ ‘ ‘  ‘  ‘ ‘=‘
  
‘   
‘ ‘   ‘ ‘  ‘‘
 ‘  ‘ ‘   ‘ ‘9‘
  ‘ ‘  ‘  ‘  ‘

)   
 

& ‘:8@‘ - ‘‘ ‘ ‘‘   ‘  ‘   ‘ ‘
‘  ‘   ‘ ‘ ‘ ‘‘ ‘ ‘ ‘" ‘‘ ‘  ‘
  ‘  ‘( ‘   ‘ 
‘ ‘ ‘   ‘  ‘   ‘
 ‘ ‘  ‘ ‘ ‘ ‘‘  ‘ 
‘ ‘ ‘ ‘  + ‘ ‘‘ ‘
‘ ‘   ‘ ‘‘  ‘ ‘ ‘ ‘ ‘ ‘" ‘ ‘
‘  ‘  ‘ ‘ ‘ ‘(   
‘ ‘ ‘ ‘‘  ‘ ‘

ù
‘  ‘ ‘‘   ‘  ‘ ‘ ‘   ‘ ‘‘‘
  . ‘   ‘ ‘  ‘

‘‘  ‘& ‘:8@


‘  + ‘ ‘ ‘  ‘   ‘   ‘
‘ ‘  ‘  ‘

’‘ ! "       #    ‘$‘0 ‘ ‘  ‘ ‘


  ‘  ‘‘ ‘ -  ‘ ‘  ‘ ‘  ‘   ‘
 ‘ ‘   ‘  ‘ ‘‘  ‘ ‘ ‘

’‘     /


 
    ‘$‘ ‘
  + ‘ ‘ ‘ ‘  ‘ ‘ ‘‘ ‘ ‘& ‘:8@‘ ‘
 ‘

’‘  /

   ‘C‘4  ‘ ‘ ‘   ‘ ‘
 ‘ ‘  ‘ ‘ ‘ ‘‘ ‘ ‘ ‘
‘  ‘ ‘ - ‘

’‘ 
"     0# "   )  
1  $ )1‘C‘6*4/‘ ‘‘ ‘‘ ‘ ‘  ‘ ‘  ‘
   ‘ 
‘  ‘ ‘    ‘ 
‘ ‘ ‘
  ‘


 -'(2)
   

& ‘D89‘ ‘&  $'(‘ - ‘‘ ‘ ‘  ‘‘  ‘
 ‘ ‘  ‘ ‘  ‘ ‘  ‘  ‘  ‘  ‘ ‘ ‘ ‘ ‘ ‘ ‘ ‘‘
 ‘ ‘  ‘ ‘‘  ‘ ‘  ‘ ‘  ‘ ‘‘ ‘‘ ‘
 ‘  ‘ ‘  
‘
‘ ‘ ‘‘ ‘  ‘ ‘  ‘ ‘  ‘)‘
(   ‘   ‘ ‘ ‘ ‘ ‘(  ‘‘ ‘  ‘ ‘   ‘ 
‘ ‘ ‘‘ ‘
   ‘  ‘  ‘ ‘ ‘‘  ‘& ‘D89‘

‘ ‘  ‘ ‘   


‘   ‘‘‘ ‘ ‘ ‘  ‘ ‘  ‘
 ‘ ‘  ‘ ‘ ‘ ‘ ‘   ‘  ‘ ‘  ‘ ‘   ‘‘
 ‘ $ ‘  ‘   ‘ -  ‘ ‘ ‘  ‘  ‘ ‘‘ ‘
‘ ‘ ‘ ‘  ‘ ‘ ‘ ‘2‘ ‘ ‘ ‘‘  
‘‘ ‘
 A‘ ‘ ‘‘  ‘‘ ‘( ‘ ‘ ‘ ‘ ‘) ‘ ‘  ‘
 ‘ ‘ ‘‘   ‘ ‘ ‘ ‘ ‘  
‘ ‘ ‘ ‘ ‘
- ‘ ‘  ‘ ‘

& ‘D89‘( ‘  + ‘ ‘ ‘ ‘- ‘‘ ‘   ‘ ‘&'6‘
  ‘$  ‘‘‘‘ ‘  ‘‘  ‘   
‘   ‘
Ë
‘  
‘‘  
‘  ‘ 
‘  ‘  ‘ ‘   ‘   
‘
  ‘  
‘&'6‘ ‘ ‘ ‘‘  
‘  + ‘ ‘‘
  ‘ ‘ ‘ ‘-  ‘ ‘  ‘  ‘   ‘  ‘4B5‘
  ‘ ‘4B‘‘ 
‘ 
‘    ‘ 
‘  ‘
‘ 
‘  ‘ 
‘ ‘    ‘ ‘ ‘‘ ‘  +‘   ‘
 ‘
‘ - ‘ ‘   ‘ ‘
‘  ‘ ‘4B‘  
‘  ‘ ‘ ‘
‘  ‘ ‘ ‘ ‘4B‘  ‘

0   
   
  

0"$ ‘    ‘ ‘  ‘ ‘ ‘‘ ‘ ‘   ‘ ‘ ‘


  ‘  ‘ ‘   ‘ ‘  ‘  ‘ ‘‘ ‘ ‘&'6‘:8:‘  ‘
Y  ‘    ‘ ‘ ‘  +‘ ‘$ ‘ ‘,%"‘ ‘ ‘
‘    ‘‘  ‘   ‘‘ ‘ ‘ ‘ ‘(‘
  ‘ ‘ ‘   ‘ ( ‘1 
‘  ‘ ( ‘ ‘  ‘‘
‘ ‘ ‘  
‘ ‘  ‘   ‘  ‘ 
‘ ‘‘  ‘   ‘    ‘
 ‘  ‘ ‘ ‘ ‘ ‘‘
‘
‘ 
‘  
‘
‘‘  ‘ ‘ ‘    
‘‘  + ‘ ‘ ‘
 ‘ ‘ ‘

’‘   ‘ ‘ $ ‘    ‘ ‘ ‘  ‘ ‘   ‘   ‘ ‘


  ‘ ‘$‘  ‘&'6‘:8:‘  ‘ ‘  ‘  ‘ ‘ ‘‘
  ‘ ‘ ‘ ‘ ‘   
‘  ‘   ‘  ‘ ‘
 ‘ ‘‘&    ‘‘ ‘ ‘  ‘ ‘ ‘
‘‘ ‘ ‘ ‘
’‘ 0  ‘ ‘ ‘ ‘  ‘ ‘  ‘    ‘‘  ‘)  ‘
‘( ‘  ‘ ‘ ‘
’‘ , ‘ ‘    ‘  ‘ ‘  ‘ ‘ ‘
‘# #‘
‘
’‘ , ‘ ‘ ‘‘  ‘ ‘  ‘  ‘

4 ‘  ‘ ‘ ‘    ‘‘ ‘ ‘  ‘  ‘ ‘‘


 ‘ ‘‘ ‘‘  + ‘‘  ‘ ‘  ‘ ‘ ‘ ‘ ‘
 ‘  ‘  ‘ ‘ ‘    ‘ ‘ ‘ ‘ ‘‘ ‘ ‘
‘  ‘ ‘   ‘

)  


=‘ 3‘0")'*‘) ‘&  ‘?‘E‘


9‘ 3‘&,"‘    ‘! ‘
7‘ 3‘)"0)‘&  ‘‘) ‘&  ‘?‘=8@‘

c
=‘ "
‘B ‘‘#  ‘ ‘ ‘  ‘ ‘ ‘  ‘‘ ‘
 ‘ ‘ -  ‘ ‘ ‘:8:#‘  ‘ ‘) ‘=@@7‘
988E‘F@;‘
9‘ " 
‘& 
‘ ‘& ‘/ ‘#‘ ‘&  $'(#‘"B)‘
B   ‘;D:‘988:‘77:‘
7‘ ! 
‘*‘#‘ ‘ ‘‘&  $'(#‘"  ‘‘9;‘
) ‘988:‘E‘
:‘ !
‘*  ‘# ‘ ‘ ‘‘  ‘"'#‘"   ‘
  ‘988:‘:9=‘
E‘ 1  
‘ ‘#&  $'(‘‘? ‘ ‘Y  ‘ ‘*‘/ $& ‘
 ‘&'6‘$ ‘‘ ‘ ‘  ‘988E#‘
3)4‘?‘=E‘988:‘DD‘
F‘ <=7>‘
;‘ ..    ..  .0$)  &  &  $
'( ‘
D‘ ..    .  .04'. $
. .Y  ) G988:===9 ‘
@‘ #‘" ‘' ‘  ‘&  ‘'(‘ ‘ ‘ ‘‘‘ ‘
2
‘ 
‘ ‘&   ‘ ‘   ‘" ‘ ‘
2 ‘ ‘Y  ‘4 #‘ ..   ‘) ‘988:‘‘
!  ‘   ‘=9‘B ‘988E‘H ..   .I‘
=8‘  
‘B ‘#,( ‘ ‘‘) ‘  ‘&  $'(‘
" #‘ ..    . .  (JK77;8:=‘=;‘
& ‘988:‘H    I‘
==‘/ 
‘* ‘?‘#   ‘  ‘ ‘&  $'(‘ ‘
‘ ‘"Y'‘ ‘  #‘* ‘) ‘ ‘Y ‘=;F‘
988:‘@‘E‘
=9‘B"
‘‘#)‘& ‘,( ‘&  $'(‘‘  #‘‘
) ‘F‘9887‘
=7‘B"‘ 
‘2 ‘L
‘ ‘! ‘M‘* ‘#1 ‘&  $'(‘
‘" ‘ ‘) ‘0 #‘
..    .. .9887. ‘9887‘
=:‘B 
‘0 ‘#,  ‘   ‘" ‘ ‘)  ‘‘
 ‘&  $'(#‘Y  ‘,( ‘=@;‘9887‘9F‘9‘
=E‘N0  ‘‘   ‘" ‘4 ‘)‘4 ‘  ‘Y  ‘
B  ‘0   #‘2 ‘O‘ ‘//0
‘,  ‘O‘M‘//0
‘L0B!‘
//0
‘0   " ‘//0‘2 ‘988:‘
=F‘0 ++
‘0  ‘#‘  ‘ -  ‘ ‘&  $'(#‘&  ‘
B   ‘‘988:‘:8=‘

cc
=;‘#&  $'(‘& ‘:8:‘)‘  ‘ ‘0")'*‘ -  #‘
L0B!‘) ‘988:‘
=D‘#&  $'(‘&‘‘988:‘B ‘ ‘,( ‘&‘  ‘
 ‘:8:‘ ‘  ‘P::‘‘‘988:
‘ ‘ ‘ #‘
   ‘B  ‘99
‘988E‘
=@‘# ‘  ‘ ‘&  $'(‘‘‘ ‘"  ‘!  #‘
  ‘&  ‘=9‘B ‘988E‘H   I‘
98‘Y‘& ‘ ‘&‘  ‘&    ‘" ‘" ‘
‘
‘988F‘
9=‘<=>‘0")'*A‘? ‘) ‘&  ‘  ‘   ‘" ‘' ‘Y  ‘
4 ‘‘) ‘‘ ‘&,"
‘   ‘

cÿ
È ‘^^‘ ^è ‘
‘
‘
‘‘‘
  ‘  
‘u
‘    
‘è‘  ‘^  ‘ ‘
 ‘    ‘u ‘‘
‘

^^‘ ‘  ! ‘

Java was developed by taking the best points from other programming languages, primarily C
and C++. Java therefore utilises algorithms and methodologies that are already proven. Grror
prone tasks such as pointers and memory management have either been eliminated or are
handled by the Java environment automatically rather than by the programmer. Since Java is
primarily a derivative of C++ which most programmers are conversant with, it implies that Java
has a familiar feel rendering it easy to use.

^^‘ ‘" è  u‘

Gven though Java has the look and feel of C++, it is a wholly independent language which has
been designed to be object-oriented from the ground up. In object-oriented programming (OOP),
data is treated as objects to which methods are applied. Java's basic execution unit is the 6 .
Advantages of OOP include: reusability of code, extensibility and dynamic applications.

^^‘ ‘u è" u‘

Commonly used Internet protocols such as HTTP and FTP as well as calls for network access are
built into Java. Internet programmers can call on the functions through the supplied libraries and
be able to access files on the Internet as easily as writing to a local file system.

^^‘ ‘ è è  u‘

When Java code is compiled, the compiler outputs the Java Bytecode which is an executable for
the Java Virtual Machine. The Java Virtual Machine does not exist physically but is the
specification for a hypothetical processor that can run Java code. The bytecode is then run
through a Java interpreter on any given platform that has the interpreter ported to it. The
interpreter converts the code to the target hardware and executes it.

^^‘ ‘è" ‘


Java compels the programmer to be thorough. It carries out type checking at both compile and
runtime making sure that every data structure has been clearly defined and typed. Java manages
memory automatically by using an automatic garbage collector. The garbage collector runs as a
low priority thread in the background keeping track of all objects and references to those objects
in a Java program. When an object has no more references, the garbage collector tags it for
removal and removes the object either when there is an immediate need for more memory or
when the demand on processor cycles by the program is low.

^^‘ ‘ è ‘

The Java language has built-in capabilities to ensure that violations of security do not occur.
Consider a Java program running on a workstation on a local area network which in turn is
connected to the Internet. Being a dynamic and distributed computing environment, the Java
program can, at runtime, dynamically bring in the classes it needs to run either from the
workstation's hard drive, other computers on the local area network or a computer thousands of
miles away somewhere on the Internet. This ability of classes or applets to come from unknown
locations and execute automatically on a local computer sounds like every system administrator's
nightmare considering that there could be lurking out there on one of the millions of computers
on the Internet, some viruses, trojan horses or worms which can invade the local computer
system and wreak havoc on it.
Java goes to great lengths to address these security issues by putting in place a very rigorous
multilevel system of security:

ő First and foremost, at compile time, pointers and memory allocation are removed thereby
eliminating the tools that a system breaker could use to gain access to system resources.
Memory allocation is deferred until runtime.
ő Gven though the Java compiler produces only correct Java code, there is still the
possibility of the code being tampered with between compilation and runtime. Java
guards against this by using the bytecode verifier to check the bytecode for language
compliance when the code first enters the interpreter, before it ever even gets the chance
to run.
The bytecode verifier ensures that the code does  do any of the following:
ő Forge pointers
ő Violate access restrictions
ő Incorrectly access classes
ő Overflow or underflow operand stack
ő Use incorrect parameters of bytecode instructions
ő Use illegal data conversions
ő At runtime, the Java interpreter further ensures that classes loaded do not access the file
system except in the manner permitted by the client or the user.

Sun Microsystems will soon be adding yet another dimension to the security of Java. They are
currently working on a public-key encryption system to allow Java applications to be stored and
transmitted over the Internet in a secure encrypted form.


^^‘ ‘^è è^!!‘ è^!‘

The Java compiler compiles source code to a stage which is intermediate between source and
native machine code. This intermediate stage is known as the bytecode, which is neutral. The
bytecode conforms to the specification of a hypothetical machine called the Java Virtual
Machine and can be efficiently converted into native code for a particular processor.

^^‘ ‘ è^"! ‘

By porting an interpreter for the Java Virtual Machine to any computer hardware/operating
system, one is assured that all code compiled for it will run on that system. This forms the basis
for Java's portability.
Another feature which Java employs in order to guarantee portability is by creating a single
standard for data sizes irrespective of processor or operating system platforms.

^^‘ ‘# èè^ ‘

The Java language supports many high-performance features such as  


 ‘ 
 ‘  , and  ‘
‘ .

ő Java has employed  


 to help overcome the performance problems suffered
by interpreted code as compared to native code. Since an executing program hardly ever
uses CPU cycles 100 % of the time, Java uses the idle time to perform the necessary
garbage cleanup and general system maintenance that renders traditional interpreters slow
in executing applications. [NB: Multithreading is the ability of an application to execute
more than one task (thread) at the same time e.g. a word processor can be carrying out
spell check in one document and printing a second document at the same time.]
ő Since the bytecode produced by the Java compiler from the corresponding source code is
very close to machine code, it can be interpreted very efficiently on any platform. In
cases where even greater performance is necessary than the interpreter can provide, 
  ‘  can be employed whereby the code is compiled at run-time to native
code before execution.
ő An alternative to just-in-time compilation is to link in  ‘‘
. This yields even
greater performance but is more burdensome on the programmer and reduces the
portability of the code.

^^‘ ‘u^‘

By connecting to the Internet, a user immediately has access to thousands of programs and other
computers. uuring the execution of a program, Java can dynamically load classes that it requires
either from the local hard drive, from another computer on the local area network or from a
computer somewhere on the Internet.

c
Please 
‘‘  with your comments and details of any key Java sites.

  
‘ ‘$ ‘  ‘!
‘
£  
    
   ‘

cA
 ‘4‘ ‘"  ‘‘B   ‘2‘B ‘
*‘Y ‘2 
‘1 ‘"   ‘‘
‘
 ‘ ‘ ‘ ‘  ‘ ‘ ‘  ‘‘‘ ‘ ‘ ‘  ‘ ‘
  ‘ ‘‘Y ‘  ‘  ‘ ‘‘‘)‘‘
 ‘ ‘ ‘  ‘  ‘ ‘ ‘
‘ ‘ ‘  ‘ ‘ $ $ ‘
  ‘( ‘‘‘ ‘ ‘  ‘  ‘& 
‘  ‘ ‘ ‘‘ ‘
‘‘  ‘‘ ‘ ‘ ‘  ‘ ‘


 
)‘2‘& ‘& ‘2&&‘ ‘ ‘ ‘ ‘  ‘ ‘   ‘ ‘(   ‘
 
‘  +‘ ‘‘ ‘ ‘ ‘ ‘‘  ‘ ‘‘
# $ #‘ ‘ ‘ ‘2‘  ‘ ‘  ‘ ‘    ‘ ‘
‘2&&‘ ‘‘4 $  ‘‘ ‘ ‘(‘ ‘ ‘  ‘ ‘ ‘‘
#  ‘ ‘)‘2&&‘ ‘‘ ‘ ‘- 
‘‘   ‘ ‘‘
-
‘ ‘  $ ‘(‘ ‘ ‘‘   ‘  ‘ ‘ ‘
‘ ‘ ‘ ‘ ‘   ‘‘‘

  
0‘ ‘ ‘ ‘  ‘‘ ‘2&&‘  ‘ ‘ ‘  ‘‘)‘  ‘
  ‘ ‘ ‘‘  ‘   ‘ ‘  $‘ ‘ ‘$‘ ‘
  ‘ 
‘   ‘ ‘ ‘   ‘ ‘ ‘  
‘ ‘ ‘( ‘ ‘
 ‘ ‘ ‘2&&‘ ‘ ‘ ‘‘‘ ‘ ‘(‘  ‘ ‘)‘2&&‘
 ‘ ‘ ‘  ‘ ‘$  ‘   ‘  
‘‘   ‘4 ‘ ‘
4  ‘  
‘  ‘  ‘ 
‘  $  ‘   + 
‘  $
 ‘ 
‘ ‘  
‘ $ ‘ ‘ $  ‘    
‘
 ‘
‘ ‘ ‘ ‘‘

4
 ‘ ‘ ‘‘   ‘  ‘  ‘ ‘ ‘‘‘ ‘ ‘
 ‘ ‘ ‘=@D8‘, ‘‘  ‘ ‘ ‘ ‘ ‘‘  ‘ ‘


  ‘ ‘ ‘ ‘   ‘*‘ ‘‘ ‘ ‘ 
‘  ‘ ‘ ‘
( ‘ ‘ ‘ ‘2‘& ‘& ‘"  ‘   
‘
 ‘2&&‘ ‘  ‘‘ ‘=@@8‘)‘   ‘ ‘ ‘,( ‘& ‘‘
 ‘ ‘ ‘   ‘ ‘   ‘  ‘‘‘,(‘ ‘  ‘
 ‘    ‘  ‘  ‘ ‘ ‘  ‘  ‘ ‘  ‘2&&‘‘

 
)‘2&&‘ ‘ ‘ ‘ ‘ ‘   ‘   ‘ ‘   ‘- ‘‘ ‘
 ‘  $  ‘ ‘‘‘ ‘'‘ ‘  ‘  ‘ ‘
‘  ‘‘ ‘ ‘)‘ $ ‘2&&
‘  
‘ ‘ ‘
  ‘ ‘‘ ‘  ‘‘ ‘‘  ‘* ‘‘ ‘  ‘ ‘
  ‘ ‘ ‘  ‘ 
‘    ‘ ‘  ‘  ‘ ‘‘  ‘
‘  ‘‘ ‘ ‘)‘ $ ‘2&&‘ ‘,( ‘& 
‘  
‘
‘ ‘ ‘ ‘ ‘   ‘ ‘ ‘ ‘ ‘‘

   
)‘  ‘2&&‘ ‘  ‘ ‘ ‘ 
‘‘ ‘  ‘‘ 
‘
 ‘( 
‘   ‘  ‘   ‘  ‘ ‘ ‘ ‘ ‘‘ ‘
 ‘‘ ‘ ‘   ‘  ‘ ‘  ‘ ‘ ‘ ‘  ‘ ‘ ‘
 ‘‘)‘ ‘‘- ‘ ‘ ‘- ‘‘ ‘ ‘
#
‘ #‘ ‘ ‘  ‘ ‘ ‘)‘ ‘ - ‘ ‘ 
‘ ‘   
‘
   ‘ ‘  ‘ ‘ ‘ ‘  ‘  ‘  ‘ ‘ ‘
‘  $‘   ‘ ‘‘
/ ‘Y  ‘B  &  0 ‘
‘
‘
4 ‘ ‘ ‘4‘ ‘"  ‘‘B   ‘2‘B ‘Q‘1 ‘
..   .  GE:F;@;7G $  $   $$
  R(++=Y&%F;‘
‘

Vous aimerez peut-être aussi