A java bean is a Java class that encapsulates many objects into a single object, this object is called a bean. The class of java bean is written in Java language.
The Java class that is there is reusable i.e. it can be used many times. Java Bean was developed by Sun Microsystems.
The Java Bean is a general-purpose component model.
Java Bean has the following properties:-
1:-Java bean class has no-arg constructor. 2:- It uses getter and setter functions.
3:-Java Bean is Serializable. Example of java bean:-
advantage of java bean in hindi:-
Java Bean has the following advantages:-
1:- Follows the property of Java Bean (Write once and run anywhere).
2:-Java Bean program can work in different local platform.
3:-Java Bean is platform independent, it gets run everywhere.
4: – You can easily configure Java Bean.
5: – The properties, events, and methods of Java Bean can be controlled.
6: – Configuration setting in Java Bean can be saved in persistent storage and it can be restored later.
Applet is a Java program that runs in a web browser. Whenever an applet is created, it passes through 5 states. Applet’s life cycle consists of 5 states and 5 methods.
:-Initial state:-
When a new applet is created, it is activated through init() method. The applet is initialized only once in its life.
Its syntax is as follows:-
Public Void init()
{
//action
}
:-Running State:-
When start() method is to be called then running is starting. This is the updated status of the applet.
The short sentence structure is as follows:-
public void start()
{
//Work
}
: – Idle state: –
When call the stop() method. This is the state of the applet. This method can be called many times.
The short sentence structure is as follows:-
public void stop()
{
//Work
}
:-Dead state:-
This state starts when destroy() method is called. In this state the applet is removed from memory forever. This is the fourth state of the applet. This state is executed only once.
Its syntax is as follows:- Public void destroy()
{
//action
}
:-Display state:-
This state is obtained when we call the paint() method. This method can be called multiple times.
Java is a pure object-oriented programming language, that is, procedures are not used in it, but it is only a language based on objects.
Platform Independent:-
Java is platform independent language that means it can run in any platform. This feature does not suit any other language as much as it does Java. Java is platform independent language because in Java the source code is compiled into intermediate code which we call byte code and every system that has JVM interprets the byte code.
Secure:-
The third big feature of Java is that it is a secure language. Java is the most secure because Java programs run in the java runtime environment. Java uses public key encryption and Java applications are accessed in a secure encrypted form on the Internet
Compiled and Interpreted:-
In Java the source code is compiled into byte code and then it is interpreted by JVM into machine code.
Simple, Small and Familiar:-
Java is an easy language because it has syntax similar to c++ which can be learned easily.Joint operator overloading (loading when done) header files is not used.
Portable:-
Java is a portable byte code is suitable for everyone so it is a portable; infection can be acquired.
Your message allocation is there to collect garbage in Java. Java advice from all of these is strong.
Strong:-
Distributed:-
Java is a distributed language which means that Java programs are designed to run in the Internet and HTTP and FTP protocols are used in Java so that they can be easily accessed in the Internet.
Multi threaded:-
Multi threading is used in Java, that is, in Java, the program is divided into smaller sub-programs and these sub-programs are executed sequentially.
The full name of JVM is Java Virtual Machine. JVM is a virtual machine that provides a runtime environment. JVM converts the byte code into native machine code and finally executes the native machine code in Java program. JVM executes the program and generates the output. JVM is platform independent.
JRE(java runtime environment):-
The full name of JRE is java runtime environment. JRE is also called java runtime. JRE is a part of JDK (java development kit). JRE is a set of software tools for developing Java applications.
The JRE consists of a set of class libraries and other files, which the JVM uses at runtime, and also contains the JVM. If you want to run any Java program in the system, you need to install JRE. JRE was developed by Sun Microsystems.