• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Use of Java

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the chief feature of Java & why is it so popular ?
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Portability
Write the program run anywhere(i.e. on any machine/OS)
Flexible language
Easy to use.
 
Neil Andrade
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please tell me more in detail.

Portability
Write the program run anywhere(i.e. on any machine/OS)
Flexible language
Easy to use.

 
Siva Prasad
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Neil Andrade:
Could you please tell me more in detail.


Simplified OO: syntax like C++, with no pointers, no multiple inheritance
Robustness: dynamic memory management with garbage collection
Security: VM verifies all variable and memory access
Ideal language to support software distribution and maintenance
Ideal language to support network computing
Easy to learn - The syntax is basically a simplified version C++. If you know C++, you will learn how to write syntactically correct Java very quickly because it is almost taken directly from C++. The steepest part of the learning curve is not in the syntax, but is in becoming familiar with the many class libraries that come with the Java Development Kit (JDK). Of course, there are differences. The most notable difference being that Java completely eliminates the use of pointers and memory management issues. Instead of pointers, Java makes heavy use of reference variables, with very strict type checking. After writing a few programs, I must say it is certainly nice to be able to allocate memory freely and not worry about having to free it. Java uses garbage collection techniques to clean up after you.
Easily Distributed - By seeing how widely used Java is on the Internet, you can probably guess that this language was designed to run over a network. Running Java programs is as easy as typing in a web address.
Secure - Since Java was designed to run over a network, the designers put a lot of effort into making this a secure language. The VM checks the downloaded code before it is run. The VM also puts lots of restrictions on downloaded programs. Applets can not access the file system and can not see the underlying memory structure.
Cross Platform Compatibility - This is probably one of the most important features. Java programs are interpreted, not compiled like C++ programs. Java source code is translated into a series of byte codes that the VM interprets and runs. Therefore, only the Java VM needs to be ported to the native hardware and operating system and all Java programs will run on it (at least in theory). Therefore, you can view and run Java applets and applications regardless of what kind of hardware and OS you are using as long as you have a virtual machine. This is the basis for Sun's slogan "Write once, run anywhere!"
http://blake.sunderland.ac.uk/~tb6ksa/Java.html
for other information just goto http://www.java.sun.com
cheers
Siva Prasad
 
Neil Andrade
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thks Siva but why is Java used in creating websites than say for e.g. Word & why is it more popular than C++.Also what does Vm stand for.
 
Siva Prasad
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
VM stands for Virtual Machine. To run any java program you need this VM. With the help of this you can run a java program on any machine.
For your information - Java helps you to add spice to the design of your websites where you can play songs, run animations, run games, and so on..
You can use java for creating applications like word etc..
I think you will know more about java if you have a look at the websites I mentioned above.
All you need is time and interest to know more about java and why it is so powerful
[This message has been edited by Siva Prasad (edited March 09, 2001).]
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's say I make a Web site that uses MSWord. Works great on my PC. The guy next to me is on a MAC. Darn thing just won't work. MSWord was made for windows. You have to buy something completely different if you want it to run on a Mac or on Unix or on your thermostat chip.
Java will run all of those places.
C++ has some advantages in speed, but it is also platform dependant. You have to publish multiple versions of your application to fit each operating system. In addition C++ is more complex to learn. It also has memory leak problems and constant pointer bugs, neither of which java has to deal with.
 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

It also has memory leak problems and constant pointer bugs, neither of which java has to deal with


hahaha made my day. One sure thing. C/C++ doesn't have any mermory leaks. It's the crappy software that you program that does.
On another note java leaks since object deletion relies on code external to the program. So java leaks until the GC kicks in. NOT C++.
 
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Matt C++ has no memory licks ? are you sure ? one thing is they always have to worry about destroying that object and once in awhile it can be left without being properly destroyed. While in java i have less control on it but i don't have to worry about it as much because as long as my vm is alive that object will get eventually destroyed. In some ways java is faster then c++(in some ways).
------------------
Val SCJP
going for SCJD
 
Matts Smith
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It amazes me ppl are getting java certified without any knowledge of general programming. A memory leak happens when you lost all reference to a block of memory in the heap (you can't release it anymore). Meaning that programming lanhuage don't leak. It's your software that does. Java does leak in a way because memory release relies on code external to the program you wrote. So at any given time you can be pretty sure that there will be some objects in the heap that your program lost trace of. The GC will take care of them at a later time.
in C/C++ memory releasing is explicit so if you know how to code, you don't get leaks. Unfortunately it seems good programmers are a choosen few.
 
Val Dra
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You must be one of these GOD Programmers i kneel to you.
 
Matts Smith
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ouch this has gotten out of hand.
sorry if I offended you.

[This message has been edited by Matts Smith (edited March 10, 2001).]
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The point is that memory leaks occur because of programming mistakes (I prefer to refer to them as "oversights" ). If you know what the pitfalls are, you will know how to avoid them. If you have leaky code, knowing what causes a memory leak allows you to identify where something was "overlooked."
The difference between C++ and Java is that it takes more effort in C++ than in Java to avoid writing code that produces memory leaks because there are more pitfalls in C++. The programmer bears most of the responsibility of cleaning up. Java just helps by giving virtually all of that responsibility to the GC. That doesn't mean that memory leaks cannot occur in Java. In fact, Chapter 1 of RHE shows an example of how a memory leak is produced in Java.
BTW, even good programmers can write code that leaks
J.Lacar
 
I am mighty! And this is a mighty small ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic