Object-Oriented Programming: The Basic Elements Of Object Oriented Programming

847 Words 4 Pages
Object-oriented programming is a style of programming in which the programmer may determine a data structure’s data type, as well as any operations applied to the data structure (“Cornell.edu” n.d.). It is a programming paradigm that is built around the idea of data structures, also known as “objects.” Objects are the fundamental elements of object-oriented programming. They are made up of state and behavior. An object’s state is represented by “instance variables”, and behavior is represented by procedures, known as “methods” (“Cornell.edu” n.d.). Objects may also inherit state and behavior from other objects; the object-oriented paradigm enables classes to receive common characteristics from other “classes”, which are the blueprints from …show more content…
In both languages, commenting is identical. Two forward slashes, “//”, indicate a single-line comment, while “/*…*/” indicates a multi-line comment (“cplusplus.com” n.d.). Primitive data types, such as int, float, and char, are nearly indistinguishable, and arithmetic operators, such as addition (+), subtraction (-), multiplication (*), and division (/), are carried out in the same manner. Control constructs, such as if statements, for loops, while loops, and switch statements, are also shared among both languages(“cplusplus.com” n.d.). Both languages support classes, and single inheritance in C++ is comparable to Java (“Cornell.edu” n.d.). Both Java and C++ also allow for function …show more content…
C++ was developed several years before Java, which allowed for Java to be heavily influenced by it (“Saylor.org” n.d.). Though Java was influenced by C++, it has many notable features that distinguishes it from C++, including garbage collection, and the fact that Java is platform independent. Another major difference between the languages is that Java is a WORA language, while C++ is a WOCA language. Java and C++ also share several similarities in their syntax, as both languages were influenced by C (“Cornell.edu” n.d.). Given that both languages are object-oriented languages, they are guaranteed to have many similarities, however, the current differences between the two languages is exceedingly evident, and will be continuously increasing for years to

Related Documents