#1  
23rd July 2011, 09:40 PM
Unregistered
Guest
 
Posts: n/a

Major difference between C, C++ and Java?


tell me the major difference between c,c++ and java..
could u pls send it to me now




  #2  
24th July 2011, 09:32 AM
Gita Irudhayaraj
Senior Member+
 
Join Date: Apr 2011
Location: Puducherry
Posts: 764
Default Re: Major difference between C, C++ and Java?

Hi friend,
There are different kinds of programming in computer languages.
You are asking about C,C++ and Java

Similarities in C are:
1. Structured programming in C
2.Top-down Approach
3. Very Difficult to program and it is very code of program for the applications.

C++ and Java
1. Both are object oriented programming
2. C++ is developed from c programming
3. Inheritance,Encapsulation,Constructors can be used due to object oriented programming.
4. Java main functionality is Platform Independence, Digital Signatures can be used.

These are the similarities and dissimilarities in C, C++ and Java.
All the best,
~Gita~
  #3  
25th July 2011, 01:55 AM
sumansin
Senior Member+++++
 
Join Date: Mar 2011
Location: UP
Posts: 4,211
Default Re: Major difference between C, C++ and Java?

C,C++ and Java all these are languages.

C is a middle level language because it stands in between High level languge and Low level language.Programs written in C are efficient and fast.It is used in structured programming.
C++ is derived from the C language.C++ uses compile-time binding which means that the programmer must specify the specific class of an object.C++ programs are fast and efficient, qualities which helped to make C an extremely popular programming language.
Java is an object oriented language built upon C and C++.It drives its syntax from C and its object oriented features are influenced by C++.It can be used to create application and applets.
  #4  
13th August 2011, 10:16 AM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

java is platform independent or not
Reply With Quote
  #5  
13th August 2011, 04:52 PM
balafederer
Senior Member+
 
Join Date: Jul 2011
Posts: 813
Default Re: Major difference between C, C++ and Java?

Hello,

C,C++,Java are programming languages.

C:

* C is a structure oriented program.
* C have data type struct & union but java does not have this.
C++ & java:

* C++ is a object oriented program.
* Java is a purely object-oriented program.
* Java does not support Pointers, Multiple Inheritance,Global Variables,Templates classes as in c++, Operator overloading.

thank you
Reply With Quote
  #6  
13th August 2011, 05:05 PM
saurabhkaushal333
 
Join Date: Aug 2011
Posts: 388
Default Re: Major difference between C, C++ and Java?

There are different kinds of programming in computer languages.
You are asking about C,C++ and Java

Similarities in C are:
1. Structured programming in C
2.Top-down Approach
3. Very Difficult to program and it is very code of program for the applications.

C++ and Java
1. Both are object oriented programming
2. C++ is developed from c programming
3. Inheritance,Encapsulation,Constructors can be used due to object oriented programming.
Reply With Quote
  #7  
13th August 2011, 05:50 PM
Sehwag6
Senior Member
 
Join Date: Jul 2011
Posts: 490
Default Re: Major difference between C, C++ and Java?

c,c++ and java are all programming language for creating softwares

in many it companies used these types of languages only

c is a structure oriented language

c++ and java are object oriented languages

c++ is the extension of c

in some methods are not doing in c

so we go for c++ and java
Reply With Quote
  #8  
13th August 2011, 06:45 PM
Lyk23
Senior Member
 
Join Date: Jul 2011
Posts: 304
Default Re: Major difference between C, C++ and Java?

C and Java:

C is programming language and java too.
Java doesn't include the C, unique statement keyword size of of 'type def'.
Java does not define the type modifiers keyword auto,extern,register,signed and unsigned.
Java does not support an explicit pointer type.
Java does not have a pre processor

C++:

c++ have multiple inheritance but java does not have
Java has replaced the destructor function with a finalise function.
Reply With Quote
  #9  
13th August 2011, 07:53 PM
BISWARUPYOGI
Senior Member+++++
 
Join Date: May 2011
Location: India
Posts: 38,947
Default Re: Major difference between C, C++ and Java?

Quote:
Originally Posted by Unregistered View Post
tell me the major difference between c,c++ and java..
could u pls send it to me now
dear friend,

I think the main difference between C or C++ and Java in Object-oriented. In Language C or C++, we can extend one more classes.

There are many problems from the method of extending, like the sequence of initializing the class before using it and the sequence of destroying the class. It's very hard for the beginner.

So Java doesn't allow extending from more one class. On the other side , there is the same in C++ and Java.

C is a procedure oriented language .

C++ is c with object oriented language.

Java is truely object oriented.

thanks
Reply With Quote
  #10  
13th August 2011, 09:38 PM
venkataprakash.v
Senior Member+++++
 
Join Date: Dec 2010
Location: chennai.
Posts: 4,121
Default Re: Major difference between C, C++ and Java?

Quote:
Originally Posted by Unregistered View Post
tell me the major difference between c,c++ and java..
could u pls send it to me now
C,C++ and Java all are the programming Language.C and C++ are basic for all the programming languages.

C is a Structure Oriented Programming Language and C doesn't use the Classes.

C++ is Object Oriented Programming Language and C++ use the classes.

Java is a Purely Object Oriented Programming Language.

Major difference java does n't use Pointers.But C and C++ uses the Pointers.

Java doesn't have a Pre-processor(i.e #define,#include,#if def).But C and C++ have a the Pre-processor.

And Java have the a packages.But C and C++ doesn't use the a packages.

Java does n't have template classes has in C++.

C use the top down approaches and java also use the top - down approaches.

There is a many major difference between C,C++ and Java.
Reply With Quote
  #11  
16th August 2011, 05:17 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

Almost al the companies uses Java mostly to design any project.
Java have several advantages,so mostly prefer it.
And also there are many versions in java.
Java is basically divided in to two catrgs:core java and advanced java.
Reply With Quote
  #12  
18th August 2011, 01:36 PM
Guest
 
Posts: n/a
Default Re: Major difference between C, C++ and Java?

Sir/Madam,
I have completed my B.E(ECE). but still i am very intrest in software. day after tomorow i want to attend the interview. so kindly give me the answer as soon as possible. If you have any other answer(hint) for it plz send it as well.
Reply With Quote
  #13  
18th August 2011, 06:34 PM
ssredhu
Member+
 
Join Date: Jul 2011
Location: New delhi
Posts: 97
Default Re: Major difference between C, C++ and Java?

Differences Between Java, C And C++
This article aims to set out some of the differences between C, C++ and Java. What it does not aim to do is conclude that one language is always the best one to use. Language choice depends upon a range of factors including field of application (operating systems, desktop software, web applications etc), what programming paradigm suits the application (OOP, procedural, etc), the target platform and available programmer expertise. What follows should help you decide where it might be suitable to use C, C++ or Java.

Paradigm

C is geared towards procedural programming. That is, you write a number of procedures to do certain tasks and build up a program by calling those procedures as needed.

Java, on the other hand, is geared towards OOP (object oriented programming). With OOP, you define classes which represent an entity (for example, a window, a button, a string of text, a file). From one class many objects may be created, with every object of a certain class having the fields (places to store data) and methods (named blocks of code associated with the object) as defined by the class.

It is possible to write in an object oriented style in C and in a procedural style in Java, but in each case the language will somewhat get in your way. C++ is designed to support both paradigms.

Preprocessor

All C and C++ compilers implement a stage of compilation known as the preprocessor. The preprocessor basically performs an intelligent search and replace on identifiers that have been declared using the #define or #typedef directives. #define can also be used to declare macros. For example, a macro MAX(x,y) could be defined to return whichever of x or y holds the greatest value. This is not like calling a function as the substitution is done before the code is compiled. Most of the preprocessor definitions in C and C++ are stored in header files, which complement the actual source code files.

Java does not have a preprocessor. Constant data members are used in place of the #define directive and class definitions are used in lieu of the #typedef directive, however there is no substitute for macros, which can be useful. The Java approach to defining constants and naming types of data structures is probably conceptually simpler for the programmer. Additionally, Java programs don't use header files; the Java compiler builds class definitions directly from the source code files, which contain both class definitions and method implementations.

Memory Management

In C and C++, any memory that is allocated on the heap (e.g. using malloc or new) must be explicitly freed by the programmer (e.g. using free or delete). Forgetting to free memory leads to memory leaks, and in long-running programs can lead to the memory usage of the program growing very large.

Java provides garbage collection, meaning that memory is freed automatically when it is no longer reachable by any references. This prevents memory leaks, but can lead to pauses in execution while the garbage collector runs. Also, there is no promise of timely destruction in Java.

Pointers

Most developers agree that the misuse of pointers causes the majority of bugs in C and C++ programs. Put simply, when you have pointers, you have the ability to attempt to access memory that isn't yours and modify memory relating to a different data structure than the one you intended by accident. C/C++ programmers regularly use complex pointer arithmetic to create and maintain dynamic data structures. It's powerful, but can lead to a lot of time spent hunting down complex and often subtle bugs that arise as a result of having unguarded memory access.

The Java language does not support pointers. Instead, it provides similar functionality by making heavy use of references. A reference can be thought of as a "safe pointer" - the programmer can not directly manipulate the memory address. Java passes all arrays and objects by reference. This approach prevents common errors due to pointer mismanagement. It also makes programming easier in a lot of ways simply because the correct usage of pointers is easily misunderstood by inexperienced programmers.

C++ does provide references too. It considers them as aliases to another variable or object. They are safer than pointers where they can be used.

Bounds Checking

An array in C or C++ is not bounds checked, so attempts to access the sixth element of a 5-element array will appear to work - that is, no runtime error will occur. This means the programmer needs to code very carefully, especially considering the potential for buffer overflow attacks.

Java will bounds check arrays to prevent this from happening, of course with a little extra runtime cost.

Portability And Performance

C and C++ both compile to native machine code. This means that, with a good compiler, programs written in these languages will perform very well. However, it also restricts them to running on the platform they were compiled to run on.

Java generally compiles to Java bytecode, which then runs on top of a virtual machine (the JVM). The JVM has to turn instructions in the bytecode into instructions that are understood by the machine that the bytecode is running on. This gives a runtime performance penalty (although this is getting less significant as the JVM improves and computers get faster). However, now only the virtual machine (and standard library) have to be ported to different platforms, then the bytecode for many Java programs can be executed on that platform. So bytecode is portable accross different operating systems and processors.

Complex Data Types

There are two types of complex data types in C: structures and unions. C++ adds classes to this list. Java only implements one of these data types: classes.

A structure can be emulated by a class - simply write a class without any methods and make all the fields public. However, emulating a union is not always possible in Java, and the memory saving advantages unions hold in C may not carry accross. Java presents a simpler model but at the cost of not being able to save a little memory. For many applications this will be a non-issue.

Strings

C has no built-in string data type. The standard technique adopted among C programmers is that of using null-terminated arrays of characters to represent strings. This practice if often seen in C++ programs too.

Neither C++ or Java have string as a primitive type, but they do both have string objects that are a standard part of the language. In Java this type is called String, and in C++ it is called CString.

Multiple Inheritance

Multiple inheritance is a feature of some object oriented languages that allows you to derive a class from multiple parent classes. Although multiple inheritance is indeed powerful (and sometimes the logical way to define a class hierachy), it is complicated to use correctly and can create situations where it's uncertain which method will be executed. For example, if each of the parent classes provide a method X and the derived class does not, it is unclear which X should be invoked. It is also complicated to implement from the compiler perspective.

C++ supports multiple inheritance. Java provides no direct support for multiple inheritance, but you can implement functionality similar to multiple inheritance by using interfaces in Java. Java interfaces provide method descriptions but contain no implementations. Therefore implementations can only be inherited from one class, so there is no ambiguity over which method to invoke.

Operator Overloading

Operator overloading enables a class to define special behaviour for built-in operators when they are applied to objects of that class. For example, if the * (multiply) operator was to be used on two objects of type Matrix, then matrix multiplication could be implemented. This allows object types to feel much more tightly integrated into the language and can deliver much clearer code. However, sometimes it is not clear what a particular operator would sensibly do for a particular type, whereas a well-named method call would be clear.

Operator overloading is considered a prominent feature in C++. It is not supported in Java, probably in an effort to keep the language as simple as possible and help ensure it is obvious what code does, even though it may take longer to type and read.

Automatic Coercions

Automatic coercion refers to the implicit casting of data types that sometimes occurs in C and C++. For example, in C++ you can assign a float value to an int variable, which can result in a loss of information, although a compiler warning will be given about this. Java does not support C++ style automatic coercions. In Java, if coercion will result in a loss of data, you must always explicitly cast the data element to the new type.

Goto Statement

The goto statement is rarely used these days in C and C++, but it is a standard part of the language. The goto statement has historically been cited as the cause for messy, difficult to understand, and sometimes near impossible to predict code known as "spaghetti code." The primary bad usage of the goto statement has merely been as a convenience to substitute not thinking through an alternative, more structured branching technique. Very occasionally, it can lead to clearer code.

To avoid the potential for "spaghetti code", Java does not provide a goto statement. The Java language specifies goto as a keyword, but its usage is not supported. This is consistent with Java's desire to make programmers write clear, non-messy code.

Variadic Arguments

C and C++ let you declare functions, such as printf, that take a variable number of arguments. Although this is a convenient feature, it is impossible for the compiler to thoroughly type check the arguments, which means problems can arise at runtime without you knowing. Java doesn't support variable arguments at all, though if it did it would likely be able to handle subsequent runtime problems better than C or C++.

Command-line Arguments

The command-line arguments passed from the system into a Java program differ in a couple of ways from the command-line arguments passed into a C++ program. First, the number of parameters passed differs between the two languages.

In C and C++, the system passes two arguments to a program: argc and argv. argc specifies the number of arguments stored in argv. argv is a pointer to an array of characters containing the actual arguments. In Java, the system passes a single value to a program: args. ‘args’ is an array of Strings that contains the command-line arguments.
Reply With Quote
  #14  
18th August 2011, 07:16 PM
Lyk23
Senior Member
 
Join Date: Jul 2011
Posts: 304
Smile Re: Major difference between C, C++ and Java?

hi friend ,

THE MAJOR DIFFERENCE IS GIVEN BELOW:

Difference in between c,c++ and java are given below

IN C:

Most of the c compilers support ansi c Structure.So it is easy to write the portable code in c.portability means ,suppose some one wrote code for windows OS ,that same code can be compatible with linux.i.e you have to copy and recompile in linux/unix then you can run your programe.C is procedural language so its time consuming to maintain the application in c.Its easy to write for the machine in c.

In c++ :

you cannot write portable code.Suppose you wrote c++ code for linux and you want to run the application in windows then not only we have to copy the code in windows but you need to modify the code to get it compiled.As C is OOP so it gives greater flexibility to maintain the application and quick development.

In java:

we create Byte code which is machine independent so we don't have to copy the code.Only byte code has to be copied and corresponding JVM should be present in the destination machine.So java is the internet language as internet span over many architecture.I have given the very basic difference between c,c++ and java.


THIS CONCLUDES THE MAJOR DIFFERENCES BETWEEN C ,C++, AND JAVA.


GOOD LUCK!
Reply With Quote
  #15  
19th August 2011, 01:51 PM
amaan khan ak
 
Join Date: Aug 2011
Location: bikaner
Posts: 579
Default Re: Major difference between C, C++ and Java?

Quote:
Originally Posted by Unregistered View Post
tell me the major difference between c,c++ and java..
could u pls send it to me now
there are some similarities and dissimilarities between c,c++ and java

lets discuss about c language first
there are Structured programming in C.
second property of c-its a Top-down Approach.
as compare to c++ and java,C is Very Difficult to program and it is very code of program for the application.

now to discuss about c++ and java
c++ and java are object oriented language.
java used c syntax and some programming petern like c++.
java is better than c and c++ language.
java is a simple,robust,platform independent language.so u can run the byte code of program on any type of oprating system.
i think u get ur answer

regards
amaan
Reply With Quote
  #16  
21st August 2011, 01:05 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

why we canot use pointer in java
Reply With Quote
  #17  
12th September 2011, 07:16 PM
manoj rajpurohit
Junior Member
 
Join Date: Feb 2011
Location: Bikaner
Posts: 352
Default Re: Major difference between C, C++ and Java?

c is a procedural language and it is also a structured language. c language does not support the oop characteristics.

it is a top to bottom approach language.

c++ is a object oriented language, and supports all the characteristics of oop like inheritance, encapsulation, polymorphism etc.

it contains the classes and the object for holding the variables and the function. it is an bottom to up approach

java is a platform independent language, it is also a pure oop language.

it is a world wide language and generate a byte code during the compilation of the source code, which is portable.
Reply With Quote
  #18  
23rd September 2011, 09:21 AM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

These are also correct it, but provide better format also,because of this is a high format for others, even a child also understand what is c,c ,java.so provide a better answer for it
Reply With Quote
  #19  
29th September 2011, 07:18 AM
nagamalleswararaoyaramasu
Senior Member
 
Join Date: Jun 2011
Posts: 826
Default Re: Major difference between C, C++ and Java?

my dear friend
the c language is used both high level programming and low level programming
but the c+ language is derived from c language it is working fast more than c and also it is advanced language.what are the wrongs were doing in c language not repeat this language
Reply With Quote
  #20  
1st October 2011, 09:15 PM
njsingh15
Senior Member
 
Join Date: Sep 2011
Posts: 415
Default Re: Major difference between C, C++ and Java?

Quote:
Originally Posted by Unregistered View Post
tell me the major difference between c,c++ and java..
could u pls send it to me now
the major difference between c,c++ and java are given below-
C is a modular programming language and doesn't have object-oriented features in it.
C++ supports both modular and object-oriented features.
Java is a completely object-oriented language as it doesn't allow modular programming. In Java every object has to be defined in terms of a class.
Reply With Quote
  #21  
26th October 2011, 09:33 AM
srikanthreddypalwai
Senior Member
 
Join Date: Oct 2011
Posts: 377
Default Re: Major difference between C, C++ and Java?

Quote:
Originally Posted by Unregistered View Post
tell me the major difference between c,c++ and java..
could u pls send it to me now
hii friend...here i can help you...here is the major difference between c,c++ and java.............

basic diff.:-
1.C is procedural oriented,
c++ is object oriented
java is purely object oriented(bcz we cant create a java prgrm widout creating a class)

2.java does not support multiple inheritance but c++ supports.

3. java is platform independentbut c++ isnt.

4. java do not support direct memory access dat is POINTERs.
Reply With Quote
  #22  
26th October 2011, 09:35 AM
srikanthreddypalwai
Senior Member
 
Join Date: Oct 2011
Posts: 377
Default Re: Major difference between C, C++ and Java?

Quote:
Originally Posted by Unregistered View Post
tell me the major difference between c,c++ and java..
could u pls send it to me now
hii friend...here i can help you...


basic diff.:-
1.C is procedural oriented,
c++ is object oriented
java is purely object oriented(bcz we cant create a java prgrm widout creating a class)

2.java does not support multiple inheritance but c++ supports.

3. java is platform independentbut c++ isnt.

4. java do not support direct memory access dat is POINTERs.
Reply With Quote
  #23  
16th January 2012, 05:21 PM
Murugesan M.Sc.,M.Tech.
Guest
 
Posts: n/a
Thumbs up Re: Major difference between C, C++ and Java?

tell me the major difference between c,c++ and java..
1)Java not having multiple inheritance like c++.
2) As you know already,java is an platform independent.But c and c++ doesn't having this future.
3)And c is structure oriented language it not support oops future.
4)But c++ and java having this great future.The main use of oops reuseability of the coding.
5)C and C++ doesn't support web development,where as java support web development and network future.
6)Java coding is secure.But not 100% secure.Compare with other language java is secure,thats all.
7)If we c an c++ we can able to develop only stand-along application.But if use java we can develop three language,such as J2SE(STAND-ALONG application),J2EE(Web application),J2ME(Mobile application).
Reply With Quote
  #24  
16th January 2012, 07:37 PM
Nitindesai
Junior Member
 
Join Date: Jan 2012
Location: Ahmedabad
Posts: 20
Default Re: Major difference between C, C++ and Java?

c language is procedure-oriented programming language
c++ object object oriented programming languages
java even driven programing Language.
Java is a combination of C and C++. But most of C++ features are added in the Java. The main advantage of java is it supports Web Application.
Reply With Quote
  #25  
16th January 2012, 07:51 PM
INDERPREET KAUR JOHAL
Senior Member
 
Join Date: Jan 2012
Posts: 139
Default Re: Major difference between C, C++ and Java?

c and c++ are the basics languages ,,to learn java you need to learn basics of c and c++
than you get java easily.
Reply With Quote
  #26  
5th February 2012, 10:05 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C++ and Java?

Quote:
Originally Posted by sumansin View Post
C,C++ and Java all these are languages.

C is a middle level language because it stands in between High level languge and Low level language.Programs written in C are efficient and fast.It is used in structured programming.
C++ is derived from the C language.C++ uses compile-time binding which means that the programmer must specify the specific class of an object.C++ programs are fast and efficient, qualities which helped to make C an extremely popular programming language.
Java is an object oriented language built upon C and C++.It drives its syntax from C and its object oriented features are influenced by C++.It can be used to create application and applets.
c is not middle level language basically c is a low level language
Reply With Quote
  #27  
21st February 2012, 06:44 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

Multiple Inheritance are not done in java but to do multiple inheritance in java,java have another option is Interface.
Reply With Quote
  #28  
16th March 2012, 08:59 PM
Unregistered
Guest
 
Posts: n/a
Arrow Re: Major difference between C, C and Java?

Quote:
Originally Posted by Unregistered View Post
java is platform independent or not
c++ three access specifer is used public privite and protected
but in java four all three with default.
in c++ costructor and destructed both used.
but in java only constructer used.
Reply With Quote
  #29  
16th March 2012, 09:00 PM
Unregistered
Guest
 
Posts: n/a
Arrow Re: Major difference between C, C and Java?

Quote:
Originally Posted by Unregistered View Post
java is platform independent or not
c++ three access specifer is used public privite and protected
but in java four all three with default.
in c++ costructor and destructed both used.
but in java only constructer used.
java is platform independent. but not c++
Reply With Quote
  #30  
14th May 2012, 12:55 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

difference between macros and micros
Reply With Quote
  #31  
25th May 2012, 06:03 PM
Unregistered
Guest
 
Posts: n/a
Thumbs up Re: Major difference between C, C and Java?

Quote:
Originally Posted by Unregistered View Post
java is platform independent or not
java is platform independent, at the compilation time java source code converts into byte-code. The interpreter executes this byte code at run time and give output.
Reply With Quote
  #32  
28th May 2012, 07:02 AM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

what is the basics of c & c ?
Reply With Quote
  #33  
6th July 2012, 09:23 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

i ask only difference in sentence dont paragraph
Reply With Quote
  #34  
10th July 2012, 06:26 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

Quote:
Originally Posted by Unregistered View Post
java is platform independent or not
java is platfrom independent
Reply With Quote
  #35  
13th July 2012, 05:59 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

what are the features of java
Reply With Quote
  #36  
19th July 2012, 06:55 PM
Unregistered
Guest
 
Posts: n/a
Red face Re: Major difference between C, C++ and Java?

Quote:
Originally Posted by venkataprakash.v View Post
C,C++ and Java all are the programming Language.C and C++ are basic for all the programming languages.

C is a Structure Oriented Programming Language and C doesn't use the Classes.

C++ is Object Oriented Programming Language and C++ use the classes.

Java is a Purely Object Oriented Programming Language.

Major difference java does n't use Pointers.But C and C++ uses the Pointers.

Java doesn't have a Pre-processor(i.e #define,#include,#if def).But C and C++ have a the Pre-processor.

And Java have the a packages.But C and C++ doesn't use the a packages.

Java does n't have template classes has in C++.

C use the top down approaches and java also use the top - down approaches.

There is a many major difference between C,C++ and Java.
If c and JAVA BOTH R TOP -DOWN APPROACH DEN HOW JAVA IS OBJECT ORIENTED
Reply With Quote
  #37  
20th July 2012, 12:51 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

which is more difficult java or c
Reply With Quote
  #38  
21st July 2012, 06:51 PM
Unregistered
Guest
 
Posts: n/a
Smile Re: Major difference between C, C and Java?

Quote:
Originally Posted by Unregistered View Post
java is platform independent or not
its a platform independent because it can run in other os
Reply With Quote
  #39  
1st November 2012, 10:44 AM
Guest
 
Posts: n/a
Smile Major difference between C++ and Java?

Although both are object oriented programming language and Java was derived from C++ but still there is big difference between these two languages.

You can see the actual difference once you start programming on it.

But here i am going to give you few differences between these two...

1. Java does not support operator overloading

2. A class definition in Java looks similar to a class definition in C++, but there is no closing semicolon.

3. Forward reference declarations are not required in Java.

4. Scope resolution operator (: required in C++ is but not in Java.

4. In C++ you have to re-declare static data members outside the class but such things are not required in Java

etc..
Reply With Quote
  #40  
1st November 2012, 06:09 PM
sah.alok
Senior Member
 
Join Date: Oct 2012
Posts: 132
Default Re: Major difference between C, C++ and Java?

well the main difference between c,c++ and java is that c is a structured programming language while c++ and java is a object oriented programming language,so the fact is that when you do java and c++ it has a object and class concept,everything in java and c++ is object and class concept.every programme you need to represent in the form of class and object,there is not much of a difference between c++ and java,c++ is the first object oriented technology and java is the first complete object oriented technology language,java and c++ are portable while c is not portable,this are the main difference between c,c++ and java.
Reply With Quote
  #41  
2nd November 2012, 06:11 PM
 
Join Date: Nov 2012
Posts: 12
Default Re: Major difference between C, C++ and Java?

The difference between these languages is not just a mere small differentiation on basis of syntax , semantics or functionalities of this language ....... It requires a thorough study of these languages .............

However some of the differences between these languages can be as ...........
Comparison of C, C++, C#, and Java from theoretical aspects
3.1 Data Types and Sizes
“Some common types of data types are used in the programming languages called as
the primitive types like characters, integers, floating point numbers etc.”
In C, C++, C# and Java, all variables must be declared before they are used, usually at
the beginning of the function before any executable statements.
C
In C Language, There are four basic Date type.

There are five Type Specifiers in C programming :
a) long
b) long long
c) short
d) unsigned
e) signed


[B]Reserved keywords in C language. /B]
auto else long switch
break enum register typedef
case extern return union
char float short unsigned
const for signed void
continue goto sizeof volatile
default if static while
do int struct _Packed
double

In C, every data type such as a character, integer, or floating-point number has a range
of values associated with it. The range is decided by the amount of storage that is
allocated to store a particular type of data in the memory of the computer. It depends
on the computer you’re running. This feature for C language is called
“machine-dependent”. For example, an integer might take up 32 bits on your
computer, or perhaps it might be stored in 64 bits on another computer.

C++
In C++, the basic data type is almost the same as C.
In C++, there is one more type Booleans. A Boolean, bool, can have one of the two
values true or false. A Boolean is used to express the results of logical operations.

Keyword in both C and C++.
auto else long switch
break enum register typedef
case extern return union
char float short unsigned
const for signed void
continue goto sizeof volatile
default if static while
do int struct double
Only keyword _Packed is not used in C++ any more.
There are 30 keywords that are not in C, but they are used in C++.

New keyword in C++:
asm dynamic_cast namespace reinterpret_cast
bool explicit new static_cast
catch false operator template
class friend private this
const_cast inline public throw
delete mutable protected true
try typeid typename using
virtual wchar_t

C#
The Boolean type in C# has a little difference between that in C++. In C#, the
Boolean type can only have two values: true or false. But in C++, the Boolean type
can also have 0 as the value which means false and anything else means true.
Integral Types in c# is also different from C and C++. In C and C++, the integral type
is only one type. But “in C#, an integral is a category of types. They are whole
numbers, either signed or unsigned, and the char type. The char type is a Unicode
character, as defined by the Unicode Standard.” Table 8 shows the integral types, their
size, and range.
In C#, the long data type is 64 bits, while in C++, it is 32 bits.

“The floating point type in C# is either a float or double, which the same as that in C
16
and C++ is. But there is one more data type decimal that should be used when
representing financial or money values.”

There are much more key words in C# than those in C and C++. There are total 87
reserved words in C#.
C# keywords
C# keywords / C# reserved words
abstract as base bool
break by 2 byte case
catch char checked class
const continue decimal default
delegate do double descending 2
explicit event extern else
enum false finally fixed
float for foreach from 2
goto group 2 if implicit
operator out override orderby 2
params private protected public
readonly ref return switch
struct sbyte sealed short
sizeof stackalloc static string
select 2 this throw true
try typeof uint ulong
unchecked unsafe ushort using
var 2 virtual volatile void
while where 2 yield 1
1, 2 These are not actually keywords, thus (unlike actual keywords) it is possible to define variables and
types using these names, but they act like keywords in certain new language constructs introduced in C#
2.0(1) and 3.0(2).

Java
The Boolean type in Java is as the same as that in C#. There are only two values
available for Boolean type, true and false.
Integral Types in Java is different from C and C++ and it is similar to C#. In C#, an
integral is a category consists of 9 data types. In Java, there are five data types that
can have the integral value. There is no sbyte, uint, ulong data type in Java any more.


Java has two kinds of floating-point numbers: float and double. The default type when
you write a floating-point literal is double.

There are total 50 keywords in Java. Some keywords only appear in Java, such as
synchronized, instanceof and strictfp.
Key words in Java.
abstract continue For new
switch assert default goto
package synchronized boolean do
if private this break
double implements protected throw
byte else import public
throws case enum instanceof
return transient catch extends
int short try char
final interface static void
class finally long
volatile const float native
super while
3.2 String type
In C language, there is no string type. The char type of array is used instead of String
type.
In C++ language, there are two types of strings, C-style strings, and C++-style strings.
“A C-style strings, which consists of an array of characters terminated by the null
character '\0', and which have properties over and above those of an ordinary array of
characters, as well as a whole library of functions for dealing with strings represented
in this form. Its header file is ‘cstring’. A C++ style string is a ‘class’ data type. The
objects of C++ style string are instances of the C++ ‘string’ class. There is a library of
C++ string functions as well, available by including the ’string’ header file.” [14]
20
“In C# and Java, the data type String is treated as reference type. Instance of Strings
are treated as (immutable) objects in both languages, but support for string literals
provides a specialized means of constructing them. C# also allows verbatim strings
for quotation without escape sequences, which also allow newlines.”[15]
3.3 Struct
The structure in C language has two differences from structure in C++ language.
1. C Structure can only contain data items while C++ structure can contain both data
and functions.
2. In C language, using 'struct' keyword is necessary to create a variable. But in C++
Only Structure name is needed to identify a variable.
The difference between structure in C++ and C# is significant. “In C++, a struct is
exactly like a class, except that the default inheritance and default access are public
rather than private.” On the contrary, in C#, structs have significant difference from
classes. “Structs in C# are designed to encapsulate lightweight objects. They are value
types (not reference types), so they're passed by value. In addition, they have
limitations that do not apply to classes. For example, they are sealed, which means
they cannot be derived from or have any base class other than System.ValueType,
which is derived from Object. Structs cannot declare a default (parameterless)
constructor.”
On the other hand, struct is very suitable for using a class with very small instance if
you don't care that “the struct is sealed” and you don't care “value semantics”.
“Structs are more efficient than classes so they're perfect for the creation of
lightweight objects.”
In C#, a struct can also be a value type as an as part of object or store in an array.
Java does not have struct value type.
Reply With Quote
  #42  
2nd February 2013, 07:09 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

Quote:
Originally Posted by Unregistered View Post
java is platform independent or not
java is platform independent....
Reply With Quote
  #43  
26th September 2013, 10:06 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C and Java?

Quote:
Originally Posted by Unregistered View Post
why we can not use pointer in java
java uses the concept of reference variable in place of pointer.
Reply With Quote
  #44  
26th November 2013, 05:44 PM
Unregistered
Guest
 
Posts: n/a
Default Re: Major difference between C, C++ and Java?

Dai lusu olunga java,c,c++ ku difference sollu da
Reply With Quote
  #45  
10th September 2015, 05:09 AM
Brave Boy
 
Join Date: Sep 2015
Posts: 1
Default Re: Major difference between C, C++ and Java?

) C Uses header Files but java uses Packages


2) C Uses Pointers but java doesn’t supports pointers
3) Java doesn’t supports storage classes like auto, external etc.
4) The Code of C Language is Converted into the Machine code after Compilation But in Java Code First Converted into the Bytes Codes then after it is converted into the Machine Code
5) C++ supports Operator Overloading but java doesn’t Supports Operator Overloading
6) In C++ Multiple Inheritance is Possible but in java A Class Can not Inherit the features from the two classes in other words java doesn’t supports Multiple Inheritance The Concept of Multiple Inheritances is Introduced in the Form of Interfaces
7) Java Uses import statement for including the contents of screen instead of #include
8) Java Doesn’t uses goto
9) Java Doesn’t have Destructor like C++ Instead Java Has finalize Method

10) Java Doesn’t have Structure Union , enum data types.
Reply With Quote
Do you have any question? or have anything to say?



Related Topics:

Thread Replies Last Post
Difference between CC MBA and Regular MBA? Which one is beneficial? Difference between LLM and LLB? 5 31st May 2023 10:46 PM
What is the academic difference between CBSE and ICSE board? Which board is easier to score? Any real difference in subjects from preparation stand point? 38 3rd February 2020 07:31 PM
Difference between MBA and regular MBA? Which one is beneficial? Difference between LLB and LLM? 6 9th October 2013 05:36 PM
What is difference between Information Technology and Computer Science branch in Engineering? Difference between B.Tech and B.E? 24 13th August 2012 11:56 AM
Difference between AC and DC? 23 24th June 2012 12:17 AM



Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
vBulletin Optimisation by vB Optimise.
Please also check: