Search
Relevant Links
Top 10 Articles
C# Binary Tree
A C# Binary Tree is a data structure not found in the .NET Framework. It is a rudimentary structure for searching through elements quickly and efficiently.
C# Binary Tree
C Programming Careers - Courses Simplified
Modern training techniques currently give trainees the facility to be instructed on an innovative style of course
C Programming Careers - Courses Simplified
Selecting The Right C Programming Course Provider
Selecting the Right C Programming Course Provider
Selecting The Right C Programming Course Provider
An Amazing Data Structure - Programming A Maze In C Plus Plus
In this article, we will take a close look at the construction of a maze of rectangular shape in C++
An Amazing Data Structure - Programming A Maze In C Plus Plus
C - The Influence Factor Of Many Popular Programming Languages
Many widely used languages that came after C such as C#, PHP, Java, LPC, JavaScript and Unix's Shell are directly or indirectly influenced by C
C - The Influence Factor Of Many Popular Programming Languages
Top 4 Reasons Why You Should Learn C-C++ Programming Today
In the programming field, your first job would be always to brush up your C-C++ programming language syntax and concepts
Top 4 Reasons Why You Should Learn C-C++ Programming Today
15 Good Programming Habits
15 Good Programming Habits
15 Good Programming Habits
Sprintf Manual
Sprintf Writes formatted data to string
Sprintf Manual
Analyzing C++ And Java - Exploring The Major Differences
Most of the developers previously have experience with an object-oriented programming language such as C++
Analyzing C++ And Java - Exploring The Major Differences
An Amazing Data Structure - Programming A Maze In C++
In this article, we will take a close look at the construction of a maze of rectangular shape in C++
An Amazing Data Structure - Programming A Maze In C++
Categories
Related Links

 

cprogramminginfo.com

Cprogramminginfo.com offers C Programming info to the Software Developer's Online Community.

If you have a question regarding programming in C, you will find your answer in our article base. If you are interested in posting Tips and Tricks or Hot programs in C then use our submit articles tab to submit your article. The C programming language is famous for its ability to produce speedy and efficient code

Coding Standards

Coding Standards : Analyzing C++ And Java - Exploring The Major Differences - C Programming

 

Most of the developers previously have experience with an object-oriented programming language such as C++. While you make the changeover to Java, you will come upon lots of differences, in spite of some deep similarities.

In this article, we will discuss the major differences that C++ programmers should know. These components or differences will also be logically analyzed in this article.

As a C++ programmer, you must the fundamental idea of object-oriented programming, and the syntax of Java undoubtedly appears familiar to you. This fact is logically strong since Java was derived from C++. Still, there are a storming number of differences between C++ and Java.

Such differences are planned to be major improvements, and if you recognize the differences you'll see why Java is such a helpful programming language and its advantages over other programming languages.

This article will make clear the important features that differentiate Java from C++.

Speed: The biggest potential stumbling block is speed: interpreted Java runs in the range of 20 times slower than C. Nothing forecloses the Java language from being compiled and there are just-in-time compilers coming out at this writing that offer important speed-ups. It is not implausible that full native compilers will appear for the more accepted platforms, but without those there are classes of issues that will be unsolvable with Java because of the speed issue.

Comments: Java has both kinds of comments like C++ does. 

Class: Everything must be in a class. There is no global function or global data. If you require the equivalent of globals, make static technique and static data within a class. There are virtually no structs or enumerations or unions, only classes.

Functionality: All method definitions are defined in the body of the class. Therefore, in C++ it would appear like all the functions are inlined, but they're not (inlines are noted afterward).

Class definitions: Class definitions are roughly the same form in Java as in C++, but there's no closing semicolon. Basically there are no class declarations of the form class foo, only class definitions.

class aType {

void aMethod( ) { /* method body */ }

}

Scope resolution: There's no scope resolution operator :: in Java. Java utilizes the dot for everything, but can get missing with it since you can describe elements only within a class. Still the method definitions must always happen within a class, so there is no requirement for scope resolution there either. A single place where you'll observe the difference is in the calling of static methods: you say ClassName.methodName( );. Besides this, package names are recognized using the dot, and to carry out a kind of C++ #include you use the import keyword. For example: import java.awt.*;. (#include does not straight map to import, but it has a related feel to it.

Primitive Type: Java, like C++, has primitive types for efficient access. In Java, there are char, boolean, byte, short, int, long, float, and double. The entire primitive types have specified sizes that are machine autonomous for portability. (This must have drive on performance, varying with the hardware.) Type-checking and type requirements are much strict in Java. For example:

- Conditional expressions can be only boolean, not integral.

- The result of an expression like X + Y must be used; you can't just say "X + Y" for the side effect.

Characters: The char type uses the international 16-bit Unicode character set, so it can automatically represent most national characters, ), as told by your C++ Tutor.

Strings: Static quoted strings are automatically converted into String objects. There is no autonomous static character array string similar to there is in C and C++.

Right Shift: Java adds the triple right shift >>> to act as a "logical" right shift by inserting zeroes at the top end; the >> inserts the sign bit as it shifts (an "arithmetic" shift).

Sam Qubain is a highly qualified Java Tutor, C++ Tutor & Programming Tutor with 22 years of experience and thousands of satisfied returned students.


Other Relevant Articles from this Category:
Importance Of Coding Standards
10 Reasons - Why C Should Be Your First Programming Language
Five Tips For Effective Object-oriented Programming In C++
Analyzing C++ And Java - Exploring The Major Differences
15 Good Programming Habits

More Categories:
Loops  
Comments  
Functions  
Variables  
Introduction  
Operating Systems  
Libraries  
Parameters  
Preprocessor  
Pointers  
Recursions  
Examples  
File IO  
Structures  
Linked Lists  
Coding Standards  
C C Plus Plus Training