Você está na página 1de 3

c  is a programming language originally developed by James Gosling at Sun Microsystems (which is

now a subsidiary of Oracle Corporation) and released in 1995 as a core component of Sun Microsystems'
Java platform. The language derives much of its syntax from C and C++ but has a simpler object model
and fewer low-level facilities. Java applications are typically compiled to bytecode (class file) that can
run on any Java Virtual Machine (JVM) regardless of computer architecture. Java is a general-purpose,
concurrent, class-based, object-oriented language that is specifically designed to have as few
implementation dependencies as possible. It is intended to let application developers "write once, run
anywhere". Java is currently one of the most popular programming languages in use, and is widely used
from application software to web applications.[9][10]



There were five primary goals in the creation of the Java language.

1. It should be "simple, object oriented, and familiar".


2. It should be "robust and secure".
3. It should be "architecture neutral and portable".
4. It should execute with "high performance".
5. It should be "interpreted, threaded, and dynamic".

One characteristic of Java is portability, which means that computer programs written in the Java
language must run similarly on any supported hardware/operating-system platform. This is achieved by
compiling the Java language code to an intermediate representation called Java bytecode, instead of
directly to platform-specific machine code. Java bytecode instructions are analogous to machine code,
but are intended to be interpreted by a virtual machine (VM) written specifically for the host hardware.
End-users commonly use a Java Runtime Environment (JRE) installed on their own machine for
standalone Java applications, or in a Web browser for Java applets.

Java uses an automatic garbage collector to manage memory in the object lifecycle. The programmer
determines when objects are created, and the Java runtime is responsible for recovering the memory
once objects are no longer in use. Once no references to an object remain, the unreachable memory
becomes eligible to be freed automatically by the garbage collector. Something similar to a memory leak
may still occur if a programmer's code holds a reference to an object that is no longer needed, typically
when objects that are no longer needed are stored in containers that are still in use. If methods for a
nonexistent object are called, a "null pointer exception" is thrown.

c  

1. C++ is the advanced version of c i.e.C with Classes whereas
Java is the platform independent as it works on any type of operating system
2. Java is reusable and more reliable,more secure than c++.
3. C++ is a purely object oriented language and java is not due to non supportal of multiple
inheritance

4. The main difference between c++ and java is that "C++ does
not allow persistence because it does not support database
connection while Java allows persistence because it
supports database connection."
5. The main differences between c++ and Java are that "The
features that are present in C++ are not present in Java.

a. 1) Pointers. 2) Template 3) Virtual fuctions.

6. The main difference between c++ and java is that java is


consistent and it is a dynamic model.it is compact and
portable binary code while c++ is not. and most important
difference is the it has safe and secure execution
environment.

7. C++ SUPPORTS CONCEPTS OF POINTERS ,FRIEND FUNCTION


BUT IN JAVA CONCEPT OF POINTERS AND FREIND FUNCTION IS NOT
AVAILABLE
‰ 

      
V The ÿ  
   ideal has not been achieved (tuning for different
platforms usually required), but closer than with other languages.


 
  
V Object oriented throughout - no coding outside of class definitions, including „ .
V An extensive class library available in the core language packages.

        


V Code is compiled to bytecodes that are interpreted by a Java virtual machines (JVM) .
V This provides portability to any machine for which a virtual machine has been written.
V The two steps of compilation and interpretation allow for extensive code checking and
improved security.

 è 

V Exception handling built-in, strong type checking (that is, all data must be declared an
explicit type), local variables must be initialized.

 2      
 
     
V No memory pointers
V No preprocessor
V Array index limit checking
 Î        
V Automatic garbage collection - memory management handled by JVM.

 2 
V No memory pointers
V Programs runs inside the virtual machine sandbox.
V Array index limit checking
V Code pathologies reduced by
´    - checks classes after loading
´  - confines objects to unique namespaces. Prevents loading a hacked
"ï   
  
" class, for example.
´    - determines what resources a class can access such as reading
and writing to the local disk.

    


V The linking of data and methods to where they are located, is done at run-time.
V New classes can be loaded while a program is running. Linking is done   .
V Even if libraries are recompiled, there is no need to recompile code that uses classes in
those libraries.

This differs from C++, which uses static binding. This can result in   classes for
cases where linked code is changed and memory pointers then point to the wrong
addresses.

 u   
V Interpretation of bytecodes slowed performance in early versions, but advanced virtual
machines with adaptive and just-in-time compilation and other techniques now typically
provide performance up to 50% to 100% the speed of C++ programs.

   
V å    processes, called threads, can easily be spun off to perform
multiprocessing.
V Can take advantage of multiprocessors where available
V Great for multimedia displays.

   
V Java was designed with networking in mind and comes with many classes to develop
sophisticated Internet communications.

Você também pode gostar