What is an Advantage of Java over C++ ?

Hi guys....... I am new to java...... Need to clear my basics about java.......

Why java is developed?.........What are the advantages of Java over C++?

Can't we write the same java code in C++?

[214 byte] By [Hitsa] at [2007-11-27 11:35:35]
# 1

> Hi guys....... I am new to java...... Need to clear

> my basics about java.......

>

> Why java is developed?.........What are the

> advantages of Java over C++?

>

> Can't we write the same java code in C++?

Type those questions into Google. No need to go through all that again just because you haven't yet researched the topic.

~

yawmarka at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 2

what did this same thread from 2 weeks ago devolve into?

was that the hits from the 80's thread?

or was it that blackmage thread?

TuringPesta at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 3

... at least once a week.

petes1234a at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 4

> what did this same thread from 2 weeks ago devolve

> into?

> was that the hits from the 80's thread?

Perhaps. I remember one reply was:

Young man, are you listening to me?

I said, young man, what do you want to be?

But then again, that could have been addressed to blackie.

BigDaddyLoveHandlesa at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 5

it was the "engineers vs. programmers" thread.

"Why Learn Java over C++?"

http://forum.java.sun.com/thread.jspa?threadID=5193207&start=0&tstart=0

TuringPesta at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 6

hey... I have idea @ Java But the following doubt are still there....

1 - Internal part of java is still made of C, C++ . So why to Use Java Which has such a heavy JVM which is affecting performance?

2 - in C++ , when we call free(), It just frees the memory.......While in JaVA , U need to depend upon JVM for deallocating the memory..... U can't free the memory just by calling garbage collector....... U need to first make the variable as NULL.

3 - About platform independency, Your target environment is handeled by JVM.........Which takes a large amount of memory..... So why can't we create an application in C++ for multiplatform user Using cross compiler?.........

4 - Two main issues in Java are memory consumption & Performance.... How to solve that?

Hitsa at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 7

30 Helens agree... many scientists with fancy degrees found it

necessary to write Java for some reason.

TuringPesta at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 8

> 1 - Internal part of java is still made of C, C++ .

Nope. Some implementations of the JVM may use C or C++, but that's certainly not a requirement. All of it's compiled to machine code, anyway, so why not just use ASM and get *really* optimized, eh?

> So why to Use Java Which has such a heavy JVM which

> is affecting performance?

What data are you using that suggests the JVM is "heavy" and "affects performance"?

> 2 - in C++ , when we call free(), It just frees the

> memory.......While in JaVA , U need to depend upon

> JVM for deallocating the memory..... U can't free the

> memory just by calling garbage collector....... U

> need to first make the variable as NULL.

Frighteningly wrong.

> 3 - About platform independency, Your target

> environment is handeled by JVM.........Which takes a

> large amount of memory..... So why can't we create an

> application in C++ for multiplatform user Using cross

> compiler?.........

You can, but you lose the benefits of the HotSpot JVM.

> 4 - Two main issues in Java are memory consumption &

> Performance.... How to solve that?

What issue?

~

yawmarka at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 9

no KITH fans huh, lol?

TuringPesta at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 10

> 1 - Internal part of java is still made of C, C++ .

> So why to Use Java Which has such a heavy JVM which

> is affecting performance?

>

why use C++ when you can just as easily poke instructions directly into the CPU?

> 2 - in C++ , when we call free(), It just frees the

> memory.......While in JaVA , U need to depend upon

> JVM for deallocating the memory..... U can't free the

> memory just by calling garbage collector....... U

> need to first make the variable as NULL.

>

Who is this weird person called "U" who does all that?

> 3 - About platform independency, Your target

> environment is handeled by JVM.........Which takes a

> large amount of memory..... So why can't we create an

> application in C++ for multiplatform user Using cross

> compiler?.........

>

They did, it's called Java. Java does exactly that.

> 4 - Two main issues in Java are memory consumption &

> Performance.... How to solve that?

they're not issues...

jwentinga at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 11

> ... at least once a week.

I'm surprised we haven't seen a "Why doesn't x = x++ work?" thread in a while.

floundera at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 12

> > ... at least once a week.

>

> I'm surprised we haven't seen a "Why doesn't x = x++

> work?" thread in a while.

summer vacation, so no fresh group of kids starting their courses for a few weeks.

Instead we get the hopeless cases who failed their exams and now are desperate to cheat their way past the retakes.

jwentinga at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 13

Then how do u free the menory in java & C++

Hitsa at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 14

> Then how do u free the menory in java & C++

Pull the plug on the machine

georgemca at 2007-7-29 17:03:39 > top of Java-index,Java Essentials,New To Java...
# 15

> > Then how do u free the menory in java & C++

> Pull the plug on the machine

george, im nominating you for best response of the week.

this thread was a few days old though?

"29 Helens agree, punctuality is important..."

TuringPesta at 2007-7-29 17:03:44 > top of Java-index,Java Essentials,New To Java...
# 16

> > > Then how do u free the menory in java & C++

> > Pull the plug on the machine

>

> george, im nominating you for best response of the

> week.

:-) cool

That's the only way I can think of to free memory in both Java and C++

georgemca at 2007-7-29 17:03:44 > top of Java-index,Java Essentials,New To Java...