Solved

Java servlet and Java applets

Posted on 2001-07-24
3
166 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

747 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

12 Experts available now in Live!

Get 1:1 Help Now