Unit 2A - Java Basics Part 1
Unit 2A - Java Basics Part 1
Part 1
@UD
Object-Oriented
• Designed to support Object Oriented concepts
• Contains non-Object Oriented primitive data types
What is Java? (cont)
Distributed
• Applications constructed using objects.
• Objects distributable in multiple locations (within a network
environment).
• Extensive integration with TCP/IP
Interpreted
• Compiles to byte-code (not machine code). Byte code is
interpreted
• Most Java versions after 1.2 include JIT (Just-In-Time) compiler
(which compiles byte code to machine code)
Robust
• Memory management done automatically
• Use of pointers limited
What is Java? (cont)
Secure
• All Java code subject to security
model.
Architecture-Neutral/Portable
• Compiled Java (byte code) will run
on any platform having JVM (Java
Virtual Machine)
• The Java Virtual Machine is
available for almost all platforms
(even mainframes)
What is Java? (cont)
High-Performance
• Originally, Java's performance was poor
• Now, Java's performance rivals C++
Multi-Threaded
• Processes contain multiple threads of execution.
• Similar to multi-tasking but all threads share the same memory
space
Dynamic
• Makes heavy use of dynamic memory allocation.
• Classes can be dynamically loaded at any time.
Platform Independence - How Java does it?
$ javac HelloWorld.java
[ compiler output ] errors and warnings
To execute, run the Java VM and include the name of the class
which contains the "main" method as the first command line
parameter.
$ java HelloWorld
Hello World note: do not include the .class extension