Web Technology
Web Technology
•Java syntax is based on C++ (so easier for programmers to learn it after C++).
•Java has removed many complicated and rarely-used features, for example, explicit pointers,
operator
overloading, etc.
•There is no need to remove unreferenced objects because there is an Automatic Garbage Collection
in Java.
2. OBIJECT-ORIENTED
Java is an object-oriented programming language. Everything in Java is an object. Object-oriented
means we organize our software as a combination of different types of objects that incorporate both
1.Object
2.Class
3.Inheritance
4.Polymorphism
5.Abstraction
6.Encapsulation
3.PLATFORM INDEPNDENT
Java is platform independent because it is different from other languages
like C, C++, etc. which are compiled into platform specific machines while Java
The Java platform differs from most other platforms in the sense that it is a
1. Runtime Environment
Java code can be executed on multiple platforms, for example, Windows, Linux, Sun Solaris, Mac/OS,
etc. Java code is compiled by the compiler and converted into bytecode. This bytecode is a platform-
independent code because it can be run on multiple platforms, i.e., Write Once and Run Anywhere
(WORA).
4.SECURED
Java is best known for its security. With Java, we can develop virus-free systems. Java is
secured because:
• Classloader: Classloader in Java is a part of the Java Runtime Environment (JRE) which is used
to load Java classes into the Java Virtual Machine dynamically. It adds security by separating
the package for the classes of the local file system from those that are imported from
network sources.
• Bytecode Verifier: It checks the code fragments for illegal code that can violate access rights
to objects.
• Security Manager: It determines what resources a class can access such as reading and
Java language provides these securities by default. Some security can also be provided by an
5. ROBUST
The English mining of Robust is strong. Java is robust because:
• There are exception handling and the type checking mechanism in Java. All these points make Java
robust.
• ARCHITECTURAL-NEUTRAL
• PORTABLE
• HIGH PERFORMANCE
• DISTRIBUTED
• MULTI-THREAD
• DYNAMIC
2. Active
3. Blocked / Waiting
4. Timed Waiting
5. Terminated
1.New: Whenever a new thread is created, it is always in the new state. For a thread in the new
state,
the code has not been run yet and thus has not begun its execution.
2.Active: When a thread invokes the start() method, it moves from the new state to the active
state. The active state contains two states within it: one is runnable, and the other is running.
Runnable: A thread, that is ready to run is then moved to the runnable state. In the runnable state,
the thread may be running or may be ready to run at any given instant of time. It is the duty of the
thread scheduler to provide the thread time to run, i.e., moving the thread the running state.
Running: When the thread gets the CPU, it moves from the runnable to the running state. Generally,
the most common change in the state of a thread is from runnable to running and again back to
runnable
3.Blocked: The thread will be in blocked state when it is trying to acquire a lock but currently the
lock is acquired by the other thread. The thread will move from the blocked state to runnable state
when it acquires the lock.
4.Waiting state: The thread will be in waiting state when it calls wait() method or join() method.
It will move to the runnable state when other thread will notify or that thread will be terminated.
5.Timed Waiting: A thread lies in a timed waiting state when it calls a method with a time-out
parameter. A thread lies in this state until the timeout is completed or until a notification is received.
For example, when a thread calls sleep or a conditional wait, it is moved to a timed waiting state.
by the program.
•Because there occurred some unusual erroneous event, like a segmentation fault or an
unhandled exception.