Solved

Java servlet and Java applets

Posted on 2001-07-24
3
168 Views
Last Modified: 2013-11-24
what are the advantages that java servlets have over java applets?
"java is platform independent" what does it mean by that?
i heard that it is due to the bytecodes. can you guys please explain on this?
what about C and C++? are they platform independent also?
i am not so sure about C but C++ alot of people say that it is. Please clearify.
thanx alot

0
Comment
Question by:volca
  • 2
3 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6315797
> what are the advantages that java servlets have over java applets?

They are really different technologies serving different purposes so you can't really compare them.
Basically applets run on the client (browser).
While servlets run on the server.

> "java is platform independent" what does it mean by that?

That Java byte code will run on any Java enabled platform.
So you can take the same class file and run it on a Windows box, or a Linux box, or a Macintosh, without any need for recompilation.

> i heard that it is due to the bytecodes. can you guys
> please explain on this?

Java byte code (your class files) is run by a Virtual Machine (VM).

> what about C and C++? are they platform independent also?

No, they produce native code to run on a particular platform.

> i am not so sure about C but C++ alot of people say that
> it is. Please clearify.

Say it is what?
0
 
LVL 7

Accepted Solution

by:
tomboshell earned 150 total points
ID: 6316412
>what are the advantages that java servlets have over java applets?
 Applets are embedded into a web page and tend to be simple programs.  They are limited in what they can due on the downloaded machine(client) unless they are 'signed'.  Not all client machines may have the right plug-in or support for the applet.   Servlets run on the server and are intended to enhance the server performance.  One use of Servlets is to present a 'dynamic' web page/pages.  (simple definition) Dynamic in that what will be presented can depend on what info/selections the user makes.  This is good for transactions.  The use of servlets take less time to load than applets (generally) and may not be noticable to the user.  

By platform independant, means that the program will run on any computer that it is loaded onto.  This only depends on the interested machine having the JDK/JRE installed.  These are what enable the java program to run.  One is a development kit, the other is simply a run-time environment.

Byte code is simply how the data is stored.  A byte is 8 bits in size, so the data is stored in chunks of data and will be processed in chunks.

What is different with Java and C/C++ is the virtual machine.  Java has a virtual machine in the JDK/JRE that does the processing.  The program runs in this machine which establishes basically the same enviroment to the Java program irregardless of where it runs.  C/C++ is usually written specifically for a certain platform (operating system).  The other issue that leads to a difference is the Endian order (don't know about the spelling there.)  One system will write its data with the Most Signifigant Bit first, the other will write it the other way.  This would have to be taken into consideration with C.  Java is automatic.  

C/C++ are not platform independant, they may be capable of making similar calls on diffent machines.  The language is the same across many machines since the language has been standardised; however, once compiled on one machines it is optimized for that machine/operating system type.  So, a W98 program does not run on a Linux machine.  But Java does.  :)

Tom
0
 
LVL 7

Expert Comment

by:tomboshell
ID: 6326051
thank you and I hope that it helped.
Tom
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
network + 7 80
unix in java example 9 53
listing all functions in JavaScript 19 179
HTTPSessionBindingListernter not configured in deployment descriptor 2 38
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now