TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Monday, 2 December 2019

c++ vs java | c++ java


C++ vs Java

 java vs c++ example
C++ vs  java
C++ java
C++ java


There are many differences and similarities between the C++ programming language and java. A list of top differences between C++ and java are given below:



Comparison Index
                C++
          Java
Platform-independent

C++ is platform dependent.
Java is platform-independent.
Mainly used for
C++ is mainly used for system programming.    
Java is mainly used for application programming. It is widely used in window, web-based, enterprise and mobile applications.
Design Goal
C++  was   designed
 for systems and application programming. It was an extension of C programming language.
Java was designed and create as an interpreter for printing systems but later extended as a support network computing. It was designed with a goal of being easy to use and accessible to a broader audience.
Goto
C++ support  goto statement
Java doesn’t support goto statement
Multiple Inheritance
C++ support multiple inheritance
Java doesn’t support multiple inheritance through class .It can be achieved by interfaces in java.


Pointers
C++ support pointers. You can write pointer program in c++.
Java supports pointer internally. However, you can’t write the pointer program in java. it means java has restricted support in java.
Compile and Interpreter
C++ support only compiler. C++ is compiled and run using the compile which converts source code into machine code so, C++ is platform dependent.

Java user use compiler and interpreter both. Java source code is converted into bytecode at compilation time. The interpreted executes this bytecode at runtime and produce output. Java is interpreted that is why it is platform independent.


Structure and Union

C++ support structure and union.
Java supports call by value only. There is no call by reference in java.

Thread Support
C++ doesn’t support have built-in-support for threads. It relies on third-party libraries for thread support.
Java doesn’t support structure and union.

Documentation comment
C++ supports documentation comment.
Java supports documentation comment(/** … */) to create documentation for java source code.
Unsigned right shift>>>
C++ doesn’t supports >>> operator.
Java supports unsigned right shift >>> operator that files Zero at the top for the negative numbers. For positive numbers, it works same like>> operator.
Inheritance Tree
C++ create a new inheritance always.
Java uses a single inheritance tree always because all classes are the child of Object class in java. The object class is the root of the inheritance tree in java.
Hardware
C++ is nearer to hardware.
Java is not so interactive with hardware.
Object-Oriented
C++ is an Object Oriented language. However, in c language, single root hierarchy is not possible.
Java is also an object Oriented language. However everything (except fundamental types) is an object in Java. It is a single root hierarchy as everything gets derived form java.lang.Object.
 

  c++ java  syntax
C++ ,Java

 




Note:

  • ·       Java doesn’t support default arguments like c++.
·       Java does not support header files like C++. Java uses the import keyword to include different classes and methods. 

     C++Example

 

 c++ vs java syntax
c++ vs java

  

 

    1.    #include<iostream>
    2.    Using namespace std;
    3.    Void main() {
    4.    Cout<< “Hello C++ Programming”;

Java Example 

 

c++ vs java
java 

 

1.    class Simple{
2.    public static void main(String agrs[]){
3.    System.out.println(“Hello Java”);
4.    }
5.    }

 java vs c++ syntax
java VS C++
Execution of c/c++


Source code-----compile------machine code-----IBM only or Windows only
 

Execution of Java

Source code-----Intermediate code------Agent---IBM intel Windows Mac
Source code-----Byte code---------------JVM----IBM intel Windows Mac
 


 

 

No comments:

Post a Comment