Solved

Java servlet and Java applets

Posted on 2001-07-24
3
175 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 239
SequenceInputStream example 3 21
Java program running SQL query 5 48
learn programming 8 68
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

749 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