Core Java
, What is Java?
• Java is a programming language and a platform.
• Java is a high level, robust, secured and object-oriented programming
language.
• Developed by Sun Microsystems (James Gosling)
• Based on C/C++
• Designed for easy Web/Internet applications
, Features of java
Simple
◦ no pointers
◦ automatic garbage collection
◦ rich pre-defined class library
Object oriented
◦ focus on the data (objects) and methods manipulating the data
◦ all functions are associated with objects
- potentially better code organization and reuse
Interpreted
◦ java compiler generate byte-codes, not native machine code
◦ the compiled byte-codes are platform-independent
◦ java byte codes are translated on the fly to machine readable
instructions in runtime (Java Virtual Machine)
Portable
◦ same application runs on all platforms
◦ the sizes of the primitive data types are always the same
, Features of java
Reliable
◦ extensive compile-time and runtime error checking
◦ no pointers but real arrays. Memory corruptions or unauthorized memory accesses
are impossible
◦ automatic garbage collection tracks objects usage over time
Secure
◦ usage in networked environments requires more security
◦ memory allocation model is a major defense
◦ access restrictions are forced (private, public)
Multithreaded
◦ multiple concurrent threads of executions can run simultaneously
◦ utilizes a sophisticated set of synchronization primitives (based on monitors and
condition variables paradigm) to achieve this
Dynamic
◦ java is designed to adapt to evolving environment
◦ libraries can freely add new methods and instance variables without any effect on
their clients
◦ interfaces promote flexibility and reusability in code by specifying a set of
methods an object can perform, but leaves open how these methods should be
implemented
◦ can check the class type in runtime
, What is Java?
• Java is a programming language and a platform.
• Java is a high level, robust, secured and object-oriented programming
language.
• Developed by Sun Microsystems (James Gosling)
• Based on C/C++
• Designed for easy Web/Internet applications
, Features of java
Simple
◦ no pointers
◦ automatic garbage collection
◦ rich pre-defined class library
Object oriented
◦ focus on the data (objects) and methods manipulating the data
◦ all functions are associated with objects
- potentially better code organization and reuse
Interpreted
◦ java compiler generate byte-codes, not native machine code
◦ the compiled byte-codes are platform-independent
◦ java byte codes are translated on the fly to machine readable
instructions in runtime (Java Virtual Machine)
Portable
◦ same application runs on all platforms
◦ the sizes of the primitive data types are always the same
, Features of java
Reliable
◦ extensive compile-time and runtime error checking
◦ no pointers but real arrays. Memory corruptions or unauthorized memory accesses
are impossible
◦ automatic garbage collection tracks objects usage over time
Secure
◦ usage in networked environments requires more security
◦ memory allocation model is a major defense
◦ access restrictions are forced (private, public)
Multithreaded
◦ multiple concurrent threads of executions can run simultaneously
◦ utilizes a sophisticated set of synchronization primitives (based on monitors and
condition variables paradigm) to achieve this
Dynamic
◦ java is designed to adapt to evolving environment
◦ libraries can freely add new methods and instance variables without any effect on
their clients
◦ interfaces promote flexibility and reusability in code by specifying a set of
methods an object can perform, but leaves open how these methods should be
implemented
◦ can check the class type in runtime