Androidberry logo Androidberry text logo
AndroidBerry Home
  • Learn Java
  • Java Programs
  • Interview Questions
  • Androidberry facebook
  • Androidberry twitter
  • Androidberry google plus

Java Tutorials


Basic Introduction

Decision Making

Looping

Classes and Objects

Inheritance

Interface

Packages

Exception Handling

Multithreading

Java Multithreading
Creating a Thread
Thread Life Cycle
Thread Exceptions
Thread Synchronization

Java Applets

What is Applet?
Java Applet vs Application
Creating a Applet
Displaying Applet on Webpage
Applet Lifecycle
Applet Tag
Passing Parameters to Applet
Setting Color to applet
Update and Repaint method
Using Fonts in Applet

Graphics Programming

Intro. to Graphics class
Drawing - Lines , Rectangles
Drawing - Circles and Ellipse
Drawing - Arcs
Drawing - Polygons
Drawing - Bar Charts

More on Java

Java Programs
Java Keywords Dictionary
Java Interview Questions

Java Applet vs Application


The java language can be used to create Applet and Application. But there are many differences between applet and application in java.

Following difference shows how the applets are different from real application program.

Sr no. Applet Application
1. Applet is not fully-featured application program. Application is fully-featured program.
2. Applet is written to perform a small task. Application is written to perform a particular task which can be large or small.
3. Applet is mostly used to run on the internet. Application is designed to run on internet as well as on local computer.
4. Applet do not have main() method like java program. They starts automatically by using their own methods. Application uses main() method because they are real java applications.
5. Applet cannot run freely.They are designed to run on HTML page. Application can run freely because they are stand alone applications
6. Applet cannot read or write the local computer files. Application can read or write the local computer files directly.
7. Applet cannot interconnect with other servers Application can interconnect with other servers.

Applet Example

Displaying message using applet

import java.awt.*;
import java.applet.*;
/*<applet code="Test.class" width=300 height=300> </applet>*/
public class Test extends Applet
{
    public void paint(Graphics g)
    {
	g.drawString("Hello. I'm Applet", 11, 100);
    }
}

Output

sample applet, examples of applet, message using applet

Application Example

Displaying message using Application

class Test
{
    public static void main(String args[])
    {
	System.out.println("Hello. I'm Application");
    }
}

Output


<< Previous Next >>

See Also

All Java Programs
Java Keywords
Java Interview Questions

AndroidBerry Support

About us
Contact us
Suggest us
Questions?

Follow us

Androidberry FacebookFacebook
Androidberry TwitterTwitter
Androidberry GooglePlusGoogle+
Back to top
Androidberry Name Logo