|
||||||
| 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. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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?
|
| Sponsored Links |
|
|
|
|||||
|
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 |
|
|||||
|
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 |
|
|||||
|
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 |
|
|||||
|
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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |
| 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 |
Goal: 100,000 Posts
Complete: 68%