Java And Java

691 Words2 Pages

Object-oriented languages have become the modern standard in structured programming. Two modern languages that both implement the object-oriented paradigm are C++ and Java. C++ is a free-form, compiled, intermediate level language. It was created in 1983, and its most recent revision is C++11, revised in 2011. Java is a class-based, object-oriented language, which is regarded as a higher-level programming language than C++. Java is actually built on C and C++. Both languages are widely used on many platforms.

As object-oriented programming languages, Java and C++ have features in common. However, the implementation for many features differs between the two. Both languages use a class-based style of object-oriented programming. They also feature generic programming, which is a paradigm that allows one to write code that can perform relevant operations on a variety of applicable types. Syntax between Java and C++ are extremely similar. Control flow statements are interchangeable between Java and C++, and include if, if-else, else, switch, and while, do-while, and for loops. Statements such as “break;” and “continue;” are used in loops in both languages. C++ supports one control flow statement that Java does not, and that is the “goto” statement. C++ and Java also share a very similar set of arithmetic operators.

Java and C++ are massively different in implementation details due to differentiating design philosophies and needs. For one, C++ runs on a platform’s CPU directly by being compiled directly to machine code, much like C. Java runs in a virtual machine, which is compiled in C and C++. As a result of being run on a virtual machine, Java can only access native platform functionality through use of the Java Native Interface,...

... middle of paper ...

... to create a foundation for programs to be built on. The C++ programming community writes third-party libraries for other C++ programmers to use. Java’s standard library includes everything one would want or need to build most programs, and includes GUI.

Both languages are robust and have many useful features. Java features an easy-to-use language which is based on logical noun-based ideas, with restrictions that prevent unwary or new programmers from making stupid bugs with their programs. C++ puts more responsibility on the programmer, but gives the programmer more freedom with the ways that the programmer can implement their solutions As an amateur programmer, I prefer Java’s safety features and its large standard library, despite desiring the freedom that C++ provides, even as I learn more about how to handle the responsibility that C++ puts on the programmer.

More about Java And Java

Open Document