New Features Added by Java

By: Abinaya Emailed: 1729 times Printed: 2341 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

There are a number of features in Java that have no equivalent in C++. Perhaps the three most important are multithreading, packages, and interfaces, but there are several others that enrich the Java programming environment as well.
  • Multithreading allows two or more pieces of the same program to
    execute concurrently. Further, this approach to concurrence is supported at the
    language level. There is no parallel for this in C++. If you need to multithread a C++
    program, you will need to do so manually, using operating system functions. While
    both methods allow for concurrent execution of two or more threads, Java's approach
    is cleaner and easier to use.
  • There is no feature in C++ that directly corresponds to a Java package. The closest
    similarity is a set of library functions that use a common header file. However,
    constructing and using a library in C++ is completely different from constructing and
    using a package in Java.
  • The Java interface is somewhat similar to a C++ abstract class. (An abstract class in
    C++ is a class that contains at least one pure virtual function.) For example, it is
    impossible to create an instance of a C++ abstract class or a Java interface. Both are
    used to specify a consistent interface that subclasses will implement. The main
    difference is that an interface more cleanly represents this concept.
  • Java has a streamlined approach to memory allocation. Like C++, it supports the new
    keyword. However, it does not have delete. Instead, when the last reference to an
    object is destroyed, the object, itself, is automatically deleted the next time that
    garbage collection occurs.
  • Java "removes" the C++ standard library, replacing it with its own set of API classes.
    While there is substantial functional similarity, there are significant differences in the
    names and parameters. Also, since all of the Java API library is object-oriented, and
    only a portion of the C++ library is, there will be differences in the way library routines
    are invoked.
  • The break and continue statements have been enhanced in Java to accept labels as
  • The char type in Java declares 16-bit-wide Unicode characters. This makes them
    similar to C++'s wchar_t type. The use of Unicode helps ensure portability.
  • Java adds the >>> operator, which performs an unsigned right shift.
  • In addition to supporting single-line and multiline comments, Java adds a third
    comment form: the documentation comment. Documentation comments begin with a
    /** and end with a */.
  • Java contains a built-in string type called String. String is somewhat similar to the
    standard string class type provided by C++. Of course, in C++ string is only available if
    you include its class declarations in your program. It is not a built-in type.

Java Home | All Java Tutorials | Latest Java Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.

Bookmark and Share


1. View Comment

Thank You very much :)

View Tutorial          By: RaghuCK at 2010-09-09 13:53:26
2. View Comment

thank u very much...............

View Tutorial          By: naveen at 2011-07-05 06:00:04
3. View Comment

thank u very much......... its very helpful

View Tutorial          By: ankit at 2012-10-14 20:52:24

Your name (required):

Your email(required, will not be shown to the public):

Your sites URL (optional):

Your comments:

More Tutorials by Abinaya
How to compile a Java program - javac
The clone() Method in Java
Data Types in Java
JSP Example to connect to MS SQL database and retrieve records
faces-config.xml to DirectTraffic in the JSF Application
Enabling Expression Language Evaluation in JSP
Using malloc() Function in C
ActionErrors and ActionError in Struts
Open, Creat, Close, Unlink system calls sample program in C
Structures and Functions in C
Introduction to JSP expression language
Multi-dimensional Arrays in C (Explained using date conversion program)
A C program similar to grep command in UNIX
Type Conversions in C (String to Integer, isdigit() etc)
Basics of C

More Tutorials in Java
Update contents of a file within a jar file
Tomcat and httpd configured in port 8080 and 80
Java File
Java String
Count number of vowels, consonants and digits in a String in Java
Reverse a number in Java
Student marks calculation program in Java
Handling Fractions in Java
Calculate gross salary in Java
Calculate average sale of the week in Java
Vector in Java - Sample Program
MultiLevel Inheritance sample in Java
Multiple Inheritance sample in Java
Java program using Method Overriding
Java program to check if user input is an even number

More Latest News
Most Viewed Articles (in Java )
How to Send SMS using Java Program (full code sample included)
wait(), notify() and notifyAll() in Java - A tutorial
Method Overriding in Java
What is Java?
XML and Java - Parsing XML using Java Tutorial
InetAddress Example program in Java
How to use ArrayList in Java
Method Overloading (function overloading) in Java
Read from a COM port using Java program
Vector example in Java
Stack example in Java - push(), pop(), empty(), search()
Calendar - sample program in Java
Use of return statement in Java
Student marks calculation program in Java
arraycopy example in Java
Most Emailed Articles (in Java)
Vector in Java - Sample Program
Use of return statement in Java
The Basic Structure of a Simple Java program
Taking the size of an Array at runtime & generate random numbers to populate the Array
instanceof operator example in Java
PushbackReader sample program in Java
CharArrayWriter sample program in Java
iterator() and hasNext() in Java
3-D Secure Payment or 3DS - (3-Domain Secure Payment)
What is a Java Package and how to use it?
How to use Iterator in Java
J2EE Components
The modulus Operators
The java Buzzwords
Java Chat Client Sample Applet