View RSS Feed


java tutorials

  1. Encapsulation

    by , 01-08-2012 at 12:14 PM
    To store all the variables and methods in an object is called encapsulation. Variables are declared private to hide them and getter methods are provided to access those variables. It is concept of hiding internal functionality. It helps in improving code modularity and re usability which supports refactoring. It is also important for integrity of application to encapsulate it internal variables and methods. Below code explains process of encapsulation in depth where different objects are kept hidden ...

    Updated 01-14-2012 at 07:39 PM by Java Basic

  2. Polymorphism

    by , 01-08-2012 at 12:07 PM
    It allows using objects of different types by using or calling object of only one type. This concept is called polymorphism. It will automatically call the method of desired object. It is also referred as “bottom up” method call. It helps you to add new classes of derived objects without major changes in code and breaking the code call sequence.

    Below image explains the concept of polymorphism. Send a message to a method without knowing its type. It is also known an dynamic binding ...
    Tags: polymorphism Add / Edit Tags
  3. How does the Object Oriented approach improve software development?

    by , 01-08-2012 at 11:52 AM
    There are many key benefits of the object oriented approach. Some of those benefits are:

    • Reusability: Object oriented approach support reusability of code with the help of inheritance and composition.
    • Mapping to real world problems: Object oriented approach can map real world objects with encapsulation.
    • Modular Architecture: Object oriented approach supports modular architectures where these modules can be reused.
  4. Static initialize

    by , 01-08-2012 at 11:50 AM
    All the code blocks that do not have a function name and are declared as static are executed before the constructor is called. They are usually used to initialize static fields as shown in below code.

    Java Code: This is an example of static initialize
    public class StaticInitilaizer {
    public static final int A = 5;
    public static final int B;
    //Static initializer block, which is executed only once when the class is loaded.
    static {
    if(A == 5)
    B = 10;
    B = 5;

    Updated 01-14-2012 at 07:37 PM by Java Basic

  5. 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: 1758
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
  6. 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 C’s 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 ...
    Tutorial , Import