Solved

Java servlet and Java applets

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java Restore security prompts not working 10 247
add projects t working set in maven 2 66
ejb message driven bean mdb creation steps 2 54
Crystal Reports Licensing Questions 4 83
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

734 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