Friday, August 5, 2011

Java tutorials

5.JAVASE:-2ND TUTORIAL
6.JAVASE:-3RD TUTORIAL
7.JAVASE:-4TH TUTORIAL
8.JAVASE:-5TH TUTORIAL

Wednesday, August 3, 2011

What is diffrence between c++ and java?


What is diffrence between c++ and java?
  • C++ supports pointers whereas Java does not.
  • C++ supports operator overloading,multiple inheritance but java does not.
  • Java is platform independent language but c++ is depends upon operating  system, machine etc.
  • Java uses compiler and interpreter both and in c++ their is only compiler.
  • Java has premitive data type like boolean which are not available in c++.
  • C++  does not allow persistence because it does not support database connection while Java allows persistence connection because it supports database connection.
  • C
    ++ is optional automated bounds checking.(e.g. the at () method in vector & string container) but Java is normally performs bounds checking. HotSpot can remove bounds checking.
  • c++ supports multiple inheritance but Java provides interfaces in case of multiple inheritance.
  • C++ standard libraries provide containers and associative arrays but Java libraries is inside the so-called Java Collections Framework.
  • C++ is normally compiled directly to machine code which is then executed directly by the operating system. Java is normally compiled to byte-code which the Java virtual machine (JVM) then either interprets or JIT compiles to machine code and then executes.

Syntax between c++ and java:-
C++Java
class Foo {          // Declares class Foo
public:
    int x;           // Member variable
 
    Foo(): x(0) {}   //  Constructor for Foo, initializes x
 
    int bar(int i) { // Member function bar()
        return 3*i + x;
    }
};
class Foo {               // Defines class Foo
    public int x;         // Member variable, 
                          //initialized to 0 by default
 
    public Foo() {        // Constructor for Foo
    }
 
    public int bar(int i) {// Member method bar()
        return 3*i + x;
    }
}
Foo a; 
// declares a to be a Foo object value,
// initialized using the default constructor.
// Another constructor can be used as "Foo a(args);"
Foo a; 
// declares a to be a reference to a Foo object
a = new Foo(); 
// initializes using the default constructor
// Another constructor can be used as 
"Foo a = new Foo(args);"
Foo b = a; 
// copies the contents of a to a new Foo object b;
// alternative syntax is "Foo b(a)"
Foo b = a.clone(); 
// copies the values of all members
// of this instance if, and only if,
// Foo implements a public method called
// clone() which returns a new copy of the object
a.x = 5; // modifies the object a
a.x = 5; // modifies the object a

Monday, August 1, 2011

Videos


About


WHAT IS JAVA?

Java is a programming language originally developed by James Gosling atSun Microsystems 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 typicallycompiled 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, particularly for server-client web applications.
The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1995. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. The Java language is called "oak" after oak tree stood outside Gosling office then it again renamed "JAVA".It is platform independent.It is intended to let application developers "write once and frun anywhere".