JAVA TUTORIAL

Java Intro Java Features Java vs C++ Java Simple Program Java Applet vs Application JVM,JDK or JRE Java Keywords Java Variables Java Literals Java Separators Java Datatypes Java Operators Java Statements Java Array Java String

CONTROL STATEMENTS

Java If-else Java While Loop Java Do-While Loop Java For Loop Java For-each Loop Java Switch Java Break/Continue

JAVA METHODS

Java Method Java Overloading Java Overriding

JAVA CLASSES

Java OOPs Java Classes/Objects Java Inheritance Java Polymorphism Java Encapsulation Java Abstraction Java Modifiers Java Constructors Java Interface Java static keyword Java this keyword

Java vs C++

Java

1. Java is Purely an OOPL. Since it is not possible to write a java program without using at least one class.

2. We can't create and use pointers in java.

3. Allocation and de-allocation of memory will be taken by JVM.

4. Java does not have goto statement.

5. No multiple inheritance in java but there are means to achive it.

6. Operator overloading is not available in java.

7. #define,typedef and header files are not available in java but there are means to achive them.

8. Java support 4 access specifier private, protected, public and default.

Java Example

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

C++

1. C++ is not Purely an OOPL. Since it is possible to write a C++ program without using a class.

2. We can create and use pointers in C++.

3. Allocation and de-allocation of memory is the responsibility of the programmer.

4. C++ has goto statement.

5. multiple inheritance features is available in C++.

6. Operator overloading is available in C++.

7. #define,typedef and header files are available in C++.

8. C++ support 3 access specifier private, protected and public.

C++ Example

#include <iostream>
using namespace std;
int main(){
    cout << "Hii.. C++";
return 0;