Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Java Help

Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-2006, 02:15 PM
Sionofdarkness Sionofdarkness is offline
Programming Expert
 
Join Date: Jul 2006
Posts: 385
Rep Power: 10
Sionofdarkness is on a distinguished road
Default Aren't Java and C++ similar?

I've heard that Java and C++ have similarities. I always imagined them as completely different but it seems I am probably wrong. What are the similarities between them?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-21-2006, 04:45 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 2,057
Last Blog:
wxWidgets is NOT code ...
Rep Power: 24
WingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the rough
Default

To be honest, you are better off thinking of them as being completely different. They have similar syntax, and both support object-oriented programming. Beyond that, they are designed for different purposes and with very different abilities.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-22-2006, 11:37 AM
Sionofdarkness Sionofdarkness is offline
Programming Expert
 
Join Date: Jul 2006
Posts: 385
Rep Power: 10
Sionofdarkness is on a distinguished road
Default

So their syntax is similar, I always thought it was completely different. I know they have different purposes, because Java is used online and C++ isn't used for web purposes.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-23-2006, 09:37 AM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 2,057
Last Blog:
wxWidgets is NOT code ...
Rep Power: 24
WingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the rough
Default

That's not quite accurate, either. Java was designed to be a "compile (to byte code) once, run anywhere (in a virtual machine)" language. This makes it idea for creating applets to run in web pages, but I use a number of Java programs for stand-alone games, download utilities, etc.

On the other hand, your web browser was probably written in a combination of C and C++, which is certainly meant for "web purposes". Java was developed looking at C++ for inspiration, but C++ is a DANGEROUS language. "With great power, comes great responsibilty." Java reduced the amount of power present in the language to make it safer, particularly for applets. Java also added libraries for graphics, threading, and network communication. This makes it easier to use those facilities in Java in a predictable way. For C++ you would have to get those libraries from another source. (I'm using Boost++ and SmartWin++ at the moment).

Both Java and C++ are Turing-complete languages. Anything you can do in one can be done in the other. The difference is that Java was designed to do certain things more easily, while C++ was designed to do other things more easily. As a result, you choose the language that will suit your needs as simply and readily as possible.

I'm applying to a company that programs exclusively in Delphi. They use it because it facilitates GUI programming and database connectivity while remaining highly flexible and scalable. Their software could have been done in C++, C#, (not VB.. scalability), Java, C, Cobol, Fortran, or other languages. Delphi does the best job of meeting their needs, however, so they use that.

Each language was developed for a purpose, but most languages can accomplish the same things as any other language.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-29-2006, 12:21 PM
Sionofdarkness Sionofdarkness is offline
Programming Expert
 
Join Date: Jul 2006
Posts: 385
Rep Power: 10
Sionofdarkness is on a distinguished road
Default

Why is C++ a dangerous language? I have heard that it could crash your computer if you did something wrong, but it would have to be a really big mistake.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 07-29-2006, 02:45 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 2,057
Last Blog:
wxWidgets is NOT code ...
Rep Power: 24
WingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the rough
Default

I once crashed a computer on purpose using MS-BASIC. What I did was write a program that had a counter starting at 0, and started poking 0 at where the counter was. In C++, this would be like having a pointer and writing 0's to memory addresses and then moving the pointer to the next memory address. If you aren't careful, you wipe out the memory where the operating system is being stored. Windows and Linux have mechanisms to help prevent this, but you can probably see the point(er).

If my program has a pointer that can be made to point to parts of itself, and is reading input, the input could change what the program is doing and cause it to start doing very... strange... things.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 08-21-2006, 02:27 PM
Sionofdarkness Sionofdarkness is offline
Programming Expert
 
Join Date: Jul 2006
Posts: 385
Rep Power: 10
Sionofdarkness is on a distinguished road
Default

Why did you crash it on purpose? But that's cool, if there was a person you didn't like, or something, you could send them a program that destroys their computer. Interesting.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 08-23-2006, 07:13 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 2,057
Last Blog:
wxWidgets is NOT code ...
Rep Power: 24
WingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the rough
Default

I crashed it to have fun. It took longer than I expected to crash, actually.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
questions about java games stack Java Help 3 07-02-2007 05:35 PM
MS-SQL deadlock and hang the Java application reachpradeep Database & Database Programming 1 03-11-2007 04:20 AM
Java Facts techni68 Java Help 0 01-17-2007 01:41 PM
John's Java Tutorial Index John Java Tutorials 0 01-11-2007 03:05 PM
Java Help Files xXHalfSliceXx Java Help 3 11-28-2006 11:30 PM


All times are GMT -5. The time now is 05:31 PM.

Contest Stats

Xav ........ 160.68
neerlin ........ 100
satrian ........ 100
delia ........ 100
chili5 ........ 70.08
morefood2001 ........ 36.91
MeTh0Dz|Reb0rn ........ 27.15
RyanTuosto ........ 20
gamiR ........ 19.64
John ........ 14.46

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 68%

Ads