View RSS Feed

Recent Blogs Posts

  1. Remote Interfaces, Objects, and Methods

    by
    RMI
    , 07-07-2012 at 05:18 PM
    Distributed applications are madeup of classes and interfaces, just the way all other Java applications are made. Methods are declared by the interfaces. Methods which have been declared are implemented by the classes. Perhaps, an additional method would also be declared. In distributed applications certain implementations are present in Java virtual machines, however others are not. Objects along with method which could possibly be invoked are known to be the remote objects.
    When a remote ...
  2. Static Fields and Methods

    by , 03-02-2012 at 04:16 PM
    Methods and fields might be declared static. This is also possible for C++. Only one copy is present for the complete class when field is static, rather than one copy for all class instances. If class instance is not present even then field’s copy is available. For example, given field addition in List class:

    static int numLists = 0;

    And, the given statement addition in the List constructor:

    numLists++;

    When new List object creation takes ...
    Categories
    Uncategorized
  3. Fields, Methods, and Access Levels

    by , 03-02-2012 at 04:13 PM
    • Java classes consist of methods and fields. A field is same as a C++ data member & a method is similar to a C++ member function.
    • Each method & field possess an access level:

    o private: access is possible in this class only
    o (package): access is possible in this package only
    o protected: access is possible in this package only & also in all subclasses.
    o public: access is possible anywhere this class is present.
    • Every class consist of these
    ...
    Categories
    Classes
  4. Using Interfaces

    by , 11-10-2011 at 04:32 PM (My Java Tips)
    Interfaces are used to define a contract for the classes. It has its own importance when it comes to defining standards.


    Consider the following example:

    Cars have some standard and their basic operations are the same. Each car should have operations like startCar, moveCar, stopCar etc. Toyota, Mazda and Honda are cars and each has its own way of starting, moving and stoping. So each has to have its own startCar, moveCar and stopCar method.

    How to enforce ...