[go: up one dir, main page]

0% found this document useful (0 votes)
258 views1 page

C++ Vs Java - Javatpoint

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 1

Home Java Programs OOPs String Exception Multithreading Collections JDBC Servlet JSP Spring Spring Boot Android

ions JDBC Servlet JSP Spring Spring Boot Android Projects Interview Questions

Java Training
Java Tutorial
What is Java
History of Java
Features of Java
C++ vs Java
Hello Java Program
Program Internal C++ vs Java ← prev next →

How to set path?


There are many differences and similarities between the C++ programming language and Java. A list of top differences between
JDK, JRE and JVM
C++ and Java are given below:
JVM: Java Virtual Machine
Java Variables
Java Data Types Comparison C++ Java
Unicode System Index
Operators
Keywords Platform- C++ is platform-dependent. Java is platform-independent.
independent
Control Statements
Java If-else Mainly used C++ is mainly used for system Java is mainly used for application programming. It is widely
Java Switch for programming. used in window, web-based, enterprise and mobile applications.
Java For Loop
Java While Loop Design Goal C++ was designed for systems and Java was designed and created as an interpreter for printing

Java Do While Loop applications programming. It was an systems but later extended as a support network computing. It

Java Break extension of C programming language. was designed with a goal of being easy to use and accessible to

Java Continue a broader audience.

Java Comments
Goto C++ supports the goto statement. Java doesn't support the goto statement.
Java Programs

Java Object Class Multiple C++ supports multiple inheritance. Java doesn't support multiple inheritance through class. It can
Java OOPs Concepts inheritance be achieved by interfaces in java.
Naming Convention
Object and Class Operator C++ supports operator overloading. Java doesn't support operator overloading.

Method
Overloading

Constructor
Pointers C++ supports pointers. You can write Java supports pointer internally. However, you can't write the HBO vacatures
static keyword
pointer program in C++. pointer program in java. It means java has restricted pointer in de techniek
this keyword
support in java.
Java Inheritance
Inheritance(IS-A) Compiler and C++ uses compiler only. C++ is Java uses compiler and interpreter both. Java source code is

Aggregation(HAS-A) Interpreter compiled and run using the compiler converted into bytecode at compilation time. The interpreter
which converts source code into executes this bytecode at runtime and produces output. Java is
Java Polymorphism
Method Overloading
machine code so, C++ is platform interpreted that is why it is platform independent. Ontdek onze
Method Overriding
dependent. techniek
Covariant Return Type banen op
Call by Value C++ supports both call by value and Java supports call by value only. There is no call by reference in
super keyword and Call by call by reference. java.
werkenbij
Instance Initializer block reference
alliander.com!
final keyword
Runtime Polymorphism Structure and C++ supports structures and unions. Java doesn't support structures and unions.
Dynamic Binding Union Ruimte voor 
jouw energie
instanceof operator
Thread C++ doesn't have built-in support for Java has built-in thread support.
Java Abstraction
Support threads. It relies on third-party libraries
Abstract class
for thread support.
Interface
Abstract vs Interface Documentation C++ doesn't support documentation Java supports documentation comment (/** ... */) to create
Java Encapsulation comment comment. documentation for java source code.

Package
Virtual C++ supports virtual keyword so that Java has no virtual keyword. We can override all non-static
Access Modifiers
Keyword we can decide whether or not override methods by default. In other words, non-static methods are
Encapsulation
a function. virtual by default.
Java Array
Java Array unsigned right C++ doesn't support >>> operator. Java supports unsigned right shift >>> operator that fills zero at
shift >>> the top for the negative numbers. For positive numbers, it works
Java OOPs Misc
same like >> operator.
Object class
Object Cloning
Inheritance C++ creates a new inheritance tree Java uses a single inheritance tree always because all classes
Math class
Tree always. are the child of Object class in java. The object class is the root
Wrapper Class
of the inheritance tree in java.
Java Recursion
Call By Value Hardware C++ is nearer to hardware. Java is not so interactive with hardware.
strictfp keyword
javadoc tool Object- C++ is an object-oriented language. Java is also an object-oriented language. However, everything

Command Line Arg oriented However, in C language, single root (except fundamental types) is an object in Java. It is a single

Object vs Class hierarchy is not possible. root hierarchy as everything gets derived from java.lang.Object.

Overloading vs Overriding

Java String Note


Java Regex
Java doesn't support default arguments like C++.
Exception Handling

Java Inner classes Java does not support header files like C++. Java uses the import keyword to include different classes and methods.

Java Multithreading

Java I/O C++ Example


Java Networking
File: main.cpp
Java AWT & Events

Java Swing
#include <iostream>
JavaFX using namespace std;
Java Applet int main() {
Java Reflection cout << "Hello C++ Programming";
Java Date return 0;

Java Conversion }

Java Collection

Java JDBC Java Example


Java Misc

Java New Features File: Simple.java

RMI

Internationalization

Interview Questions

Java MCQ

class Simple{
public static void main(String args[]){
System.out.println("Hello Java");
}
}

Next Topic Simple program of java

← prev next →

Help Others, Please Share

Ruimte voor 
jouw energie

Learn Latest Tutorials

PLC Illustrator Postman IoT GraphQL Xampp

Kivy A. Anywhere Ext.js UiPath Arduino Digital E.

Adwords MySQL

Preparation

Aptitude Reasoning Verbal A. Interview Company

Trending Technologies

AI AWS Selenium Cloud Hadoop ReactJS

D. Science Angular 7 Blockchain Git ML DevOps

B.Tech / MCA

DBMS tutorial Data DAA tutorial Operating Computer Compiler


Structures System tutorial Network tutorial Design tutorial
DBMS tutorial DAA
OS C. Network Compiler D.
DS

Computer Discrete Ethical Computer Software html tutorial


Organization and Mathematics Hacking Tutorial Graphics Tutorial Engineering
Architecture Tutorial Tutorial Web Tech.
E. Hacking C. Graphics
COA D. Math. Software E.

Cyber Automata C Language C++ tutorial Java tutorial .Net


Security tutorial Tutorial tutorial Framework
C++ Java tutorial
Cyber Sec. Automata C
.Net

Python tutorial List of Control Data Mining


Programs Systems tutorial Tutorial
Python
Programs Control S. Data Mining

Javatpoint Services
JavaTpoint offers too many high quality services. Mail us on hr@javatpoint.com, to get more information about given services.

Website Designing
Website Development
Java Development
PHP Development
WordPress
Graphic Designing
Logo
Digital Marketing
On Page and Off Page SEO
PPC
Content Development
Corporate Training
Classroom and Online Training
Data Entry

Training For College Campus


JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at hr@javatpoint.com.
Duration: 1 week to 2 week

Like/Subscribe us for latest updates or newsletter

LEARN TUTORIALS OUR WEBSITES OUR SERVICES CONTACT

Learn Java Javatpoint.com Website Development Address: G-13, 2nd Floor, Sec-3
Learn Data Structures Hindi100.com Android Development Noida, UP, 201301, India
Learn C Programming Lyricsia.com
Website Designing Contact No: 0120-4256464, 9990449935
Learn C++ Tutorial Quoteperson.com
Learn C# Tutorial Jobandplacement.com Digital Marketing Contact Us
Learn PHP Tutorial Summer Training Subscribe Us
Learn HTML Tutorial Privacy Policy
Industrial Training
Learn JavaScript Tutorial Sitemap
Learn jQuery Tutorial College Campus Training
Learn Spring Tutorial About Me

© Copyright 2011-2018 www.javatpoint.com. All rights reserved. Developed by JavaTpoint.

You might also like