View RSS Feed

Java Basic

Basic Java programming tutorials for learning Java fundamentals.

  1. Difference between java and C++

    by , 01-08-2012 at 11:44 AM
    Java and C++ are almost similar in syntax. Following are the major differences between these:

    • Java has no support to C++ pointers.
    • Java has no support for multiple inheritances. Java has replaced multiple inheritances with multiple interface inheritance. Interface inheritance allows methods to be inherited from different interfaces. It is also referred to as polymorphism.
    • Java has replaced destructors with finalize methods. These methods are called by the garbage collector
    ...
    Categories
    Java and C++
  2. Difference between java and other platforms

    by , 01-08-2012 at 11:41 AM
    Java is only software based platform. It runs on some specific hardware based operating systems like UNIX, Windows etc. Below diagram explains this process.

    Name:  44.JPG
Views: 1723
Size:  17.1 KB

    Java Compile and JVM


    The Java platform contains the following 2 components.

    Java Virtual Machine (JVM): It can be deployed on any hardware specific platform. It generates byte codes for the java program.
    Java Application Programming Interface
    Categories
    Tutorial
  3. Using Imports to Change Behaviour

    by , 11-30-2011 at 03:36 AM
    One thing that would be great to have is a feature that I know well from my previous experience coding in C. That is the possibility to conditional compile in order to modify the behavior of the application. A feature that is missing from Java is Cs conditional compilation, which allows you to change a switch and get different behavior without changing any other code. I think is was left out of Java is that I remember using this feature often to address issues related to compiling a program on ...
    Categories
    Tutorial , Import
  4. How to do Overloading with Generics

    by , 11-29-2011 at 05:12 PM
    Overloading is a technique often used in object orientated programming languages such as java. In the context of generics unfortunately, classic type of overloading will produce a compile time error because of erasure.

    Java Code:
    import java.util.List;
    
    public class OverloadingExample<W, T> {
    	void f(List<T> v) {
    	}
    
    	void f(List<W> v) {
    	}
    }

    What you must do to overcome this problem is to provide ...