hello!
I'm learning c++ now and after I've got to know it a bit, I was thinking of learning Java. What I want to know if it is a big step from c++ to java? Is java quit heavy to learn as c++?
thanks!
Printable View
hello!
I'm learning c++ now and after I've got to know it a bit, I was thinking of learning Java. What I want to know if it is a big step from c++ to java? Is java quit heavy to learn as c++?
thanks!
Java is actually much easier than C++. No pointers and other complex C++ concepts. But Java introduces multithreading and many other new concepts.
so, going from c++ to java wouldn't be too difficult you mean?
Not that bad. Java was based on C++. As long as you don't program in C++ like in C (i.e., you haven't created classes, you use char arrays instead of Strings, etc), then everything should be cool. Get a good book, especially one by Sams Publishing.
Heres some diffrences between C and Java just so you can take a look.
No preprocessor directives: Java treats constant definitions as
static final fields.
No global variables: Java defines an extreamly clean namespace.
Packages contain classes, classes contain methods and fields methods contain variables. Thus there is no possibility for namespace collisions.
Well-defined primative type sizes:
All the primative types in Java have well defined sizes. In C, the size of int, short ,long types is platform dependent, which hampers portability.
Foward References: The Java compiler is smarter then the C compiler in it allows methods to be invoked before being defined. This elimates the need to define function in a header file before defining them in a program file, as is done in C.
No method pointers: C allows the programmer to store the address of a function in a variable and pass that function pointer to other functions. You cannot do this with java methods but you can acheive similiar results by passing an object that implements
a particular interface.
Variable declarations anywhere: C only permitts local variable declarations to be at the beginning of a method or block. Java allows the variable declarations anywhere
within a method or block. --NOTE-- most programmers perfer to keep variable declarations at the top of a block or method however.
Garabage Collection: The Java Virtual Machine performs "Garabage Collection" or
deallocation of memory automatically. This elimates the need for Java programmers to explictly manage memory used by all object and arrays. For instance an object is
eligible for garabage collection if there are nolonger any variables that hold a refrence to that object.
Method overloading: Java programs can define multiple methods with the same name as long as the methods have diffrent parameter lists.
Dilenger, do you have that saved on your computer? :D
JAVA IS NOT BASED ON C++!!
Actually yes i do have that saved. But i do remember most of it though. It is one of the most asked questions sometimes so i keep it handy.
I did a report on it at school for an entire year, and I have worked professionally with Java for two years. Trust me, it was designed to fix the problems of C and C++.Quote:
Originally posted by sail3005
JAVA IS NOT BASED ON C++!!
Java was not designed to fix all the problems of c++. It's main goal was to be a portable language, that could go from computer to computer. The syntax may have some sililarities, but you will see those in any oop language. That doesn't mean they are based off of eachother.
The cross-platformness was the second goal. Making it a better C++ also included the cross-platformness that compiled C++ and even some source C++ lacks.
I think what the sun developers had in mind when developing Java was making it so C++ programmers wanting to migrate to Java would feel somewhat comfortable with the syantax.
exactly. which is entirely different than basing a language off of another language. C++ for example, was made to improve C, and make it an OO language, and C++ is based off of C.
Java and C++ are completely different. If you see a similarity, it is probably the syntax, because they are both OO languages.
java was designed to be the successor of C++ but was bought by Sun and hacked into a interpreted language
here is teh defintion of java from webopedia:
A high-level programming language developed by Sun Microsystems. Java was originally called OAK, and was designed for handheld devices and set-top boxes. Oak was unsuccessful so in 1995 Sun changed the name to Java and modified the language to take advantage of the burgeoning World Wide Web.
Java is an object-oriented language similar to C++, but simplified to eliminate language features that cause common programming errors. Java source code files (files with a .java extension) are compiled into a format called bytecode (files with a .class extension), which can then be executed by a Java interpreter. Compiled Java code can run on most computers because Java interpreters and runtime environments, known as Java Virtual Machines (VMs), exist for most operating systems, including UNIX, the Macintosh OS, and Windows. Bytecode can also be converted directly into machine language instructions by a just-in-time compiler (JIT).
Java is a general purpose programming language with a number of features that make the language well suited for use on the World Wide Web. Small Java applications are called Java applets and can be downloaded from a Web server and run on your computer by a Java-compatible Web browser, such as Netscape Navigator or Microsoft Internet Explorer.
Exactaly. There is no doubt java being an easier language to learn. But alot of the complexities are taken out of java. For instance Java does not support multiple class inheritance such as C++ does. Java though does support multiple interface inheritance.
ever try smalltalk?
Nope, All i know about smalltalk is that it was developed by XEROX at the PARC(Palo Alto research center). I would like to know more about it though.
What is it?
An object-oriented operating system and programming language developed at Xerox Corporation's Palo Alto Research Center. Smalltalk was the first object-oriented programming language (Simula was the very first). Although it never achieved the commercial success of other languages such as C++ and Java, Smalltalk is considered by many to be the only true object-oriented programming environment, and the one against which all others must be compared.
Hummmmm interseting. But which language came first?
You confused me there. :pQuote:
Smalltalk was the first object-oriented programming language (Simula was the very first).
Simula
So, is smalltalk still used commercially today?
IBM makes smalltalk development tools so i would think so
thats cool, i am gonna look into it.