A basic preview of Java. I have worked with C++, What are the differences?
398955
Java and C++ are remarkably similar in terms of syntax.  Java has all of the same constructs that you are familiar with: for loops, while loops, pre- and post-increment, if-then-else, etc.  So you should be able to pick up the syntax pretty quickly.\n\nThe differences between Java and C++ have more to do with structure than syntax: the way that files are arranged, the way that code is compiled and run, the way that rules are enforced, and the things that come with the package.\n\nWith Java, there is just one file to describe a class, with the interface and the implementation together in the same file.  In C++ these parts are split into a header (.h) file and an implementation (.cpp) file.  This makes things simpler, in that with Java there are half as many files to manage.  It also makes it impossible to lose half of your class, as you can in C++ by losing either the .h or the .cpp file.  It also makes your code more open: if you want to show someone your interface (API) code, then they can also see your implementation.  There is a workaround for this, however, in that you can use the Java-Doc comments to automatically generate HTML-based documentation for your code that only describes your public API.  (Another nice difference –- automatic documentation!)\n\nJava source code is compiled to .class bytecode files.  These files are then run by the Java interpreter/JVM.  This adds an extra layer between your code and the OS, but surprisingly causes very little deterioration in performance, mostly due to really smart JVMs.  This buys you two things: portability and safety.  The portability comes from the fact that code is written to the JVM, which is an idealized stack-based virtual machine, and not to the quirks of the underlying OS.  This is what leads to the infamous “write once, run anywhere” claim.  The safety comes from the fact that all bytecode is checked at run time for any malicious or mal-formed code, and the JVM can restrict the access of any piece of code so that it can't get to sensitive stuff (like your personal files, or the microphone, for instance).\n\nSafety is the common heading for several other differences between Java and C++: there are no pointers in Java (at least not directly), so there are no dangling pointers, uninitialized pointers, or bizarre pointer math errors; arrays are dynamically checked for staying within the boundaries, so there are no out-of-bounds errors; you can't cast an variable to an incompatible type in Java, so data structures can't get corrupted in that way; exceptions must be caught (this check is done at compile time), so there are no uncaught exceptions to bring down your application; and the list goes on!\n\nThus far it might seem like Java is missing a lot of things that are found in C++.  So what would you probably miss if you made the move to Java?  Pointers, templates, operator overloading, multiple inheritance, and a preprocessor.  What wouldn't you miss?  Pointers, templates, operator overloading, multiple inheritance, and a preprocessor.  You might have noticed that these two lists are remarkably similar.  How can this be?  It is one of those things where you might miss some particular feature at first, and even wonder how in the world you will do without it, but once you are familiar with Java and the way that it works, you wonder why you ever bothered with that complicated stuff in the first place.  Java has elegant replacements for many of these missing items, or better yet, makes them completely unnecessary by design.  A good example is multiple inheritance – in Java there is only a single parent class for a given user-defined class, but a class can implement any number of interfaces, which are special classes that only specify methods and operations but have no implementation whatsoever.  A class that implements a given interface can be passed anywhere that the interface is expected, regardless of its size or the way that it is implemented.  It
971319
#include <iostream>\n#include <iomanip>\n\nusing namespace std;\n\nint main() {\n\n  cout << "Welcome to F&#92;'Zone&#92;n"\n      << "&#92;n"\n      << "Please select from the following menu.&#92;n"\n      << "&#92;n"\n      << "1: Quarter pounder combo&#92;n"\n      << "&#92;n"\n      << "2: Bacon burger&#92;n" \n      << "&#92;n"\n      << "3: Swiss mushroom burger&#92;n"\n      << "&#92;n"\n      << "To place your order, enter the number of the meal you would like.&#92;n"\n      << "For instance enter 2 for a Bacon Burger.&#92;n"\n      << "&#92;n"\n      << "Please enter your selection now: ";\n  char x;\n  x = getchar();\n  double total = 0.0;\n  switch (x) {\n    case '1' :\n      total = 4.59;\n      cout << "Would you like a &#92;'biggy&#92;' size? It costs $0.39 extra.&#92;n"\n          << "Type in a 'Y' or a 'N': ";\n      //x = getchar();\n      cin >> x;\n      if (x == 'Y') {\n        total += 0.39;\n        cout << "You have chosen to have a &#92;'biggy&#92;' size.&#92;n";\n      }\n      cout << "Would you like cheese with that? It costs $0.25 extra.&#92;n"\n          << "Type in a 'Y' or a 'N': ";\n      //x = getchar();\n      cin >> x;\n      if (x == 'Y') {\n        total += 0.25;\n        cout << "You have chosen to have cheese.&#92;n";\n      }\n      break;\n    case '2' :\n      // similar to 1, just change the price and messages.\n      break;\n    case '3' :\n      // similar to 1, just change the price and messages.\n      break;\n    default :\n      cout << "You have not ordered a menu item.";\n      return 1;\n  }\n  cout << "The total of your order is $" << setiosflags(ios::fixed)\n      << setprecision(2) << total << resetiosflags(ios::fixed);\n}
645329
If you want the differences in detail go to http://java.sun.com Its the JAVA information superhighway.
1055576
Java is a better defined object-oriented language and has become very fine-tuned, with a great API with objects and methods that do about anything you want. It is also multiple platform, which means you can run programs on Windows, Linux, Mac, etc. \n\nHowever, the documentation on Java can be sketchy, and unless you are a genius, sometimes figuring out the API can be difficult. You have to be willing to spend some time figuring things out on your own. C# was basically created by Microsoft, and to give them credit, they document everything very well. But if you are not a fan of Microsoft, which many people aren't, Java is the better choice.
662885
No difference ,they are all used for dynamic allocation.only syntax difference i guess.
173498
Choose one of the three. Each has its own pros and cons.\n\nC++, Java, C#
414394
Try \n1) Let Us C++\n2) Core Java 2.0 Complete reference\nRead from the very first page and do practical examples page by page. You will defintely able to learn just like me.
861192
If you already know C++, have a look at the Allegro (2d graphics library) or Ogre3d (3d graphics library) or Irrlitcht (3d graphics library) webs. You should find a lot of information there.
521920
I am a professional programmer. My favorite languages are C++ and ASP (JavaScript). I'm not sure what you are looking for.
2853
I always recommend Bjarne Stroustrup's "The C++ Programming Language", third edition.  It cuts straight to the meat of what is different between C and C++ instead of messing around with arrays of char like most tutorials do.
484581
I am not sure what program you tried, but here is one that should work on borlands compiler.\n\n#include <iostream>\n\nint main() {\n\n    std::cout<<"Hello, world!&#92;n";\n}\n\nI have included the 'std::' namespace in front of the cout.\n\n<Edit>\nAre you running the program from the command line, or just clicking on the exe?\nIf clicking on the exe, a command line will pop up, then disappear after displaying hello world.\nYou need to run it from the command line.
195503
There is no structure in Java.\n\nProbably you are confusing with C++>
781094
Nobody is going to do your homework for you. \n\nIf you're supposed to write code examples that illustrate how two comparable programs might look, then do this. Write some simple programs in C, and then re-write the same program in C++ but put the functions your void main calls in a class and instantiate the class.
740055
C++ is just a language, like english or german is. \nAny language that a programmar programs in needs to conform to the specification of that language. There are other languages such as Visual basic, and java, and even C# or just plain C.
408935
Hey,\nthe code in JAVA would look like this ::\n\nclass test {\npublic static void main(String a[]) {\nfor(int i=1;i<100;i++) {\nSystem.out.print("&#92;t"+i+"&#92;n");\n}\n}\n}
604118
This is an identical java code for your C++ code,\n\n1. create a filename, say HelloWorld.java,\n\n2. Write in following codes,\n\npublic class HelloWorld\n{\n      public static void main (String args[])\n      {\n           System.out.println("Hello World");\n      }\n}\n\n3. Save it and compile it. Then open the class file using java.
676530
In c++\n\n#include <iostream.h>\n\nint main(int argc, char* argv[])\n{\n printf("Hello World!&#92;n");\n return 0;\n}