9/17/11

9/12/11

OOPs Concept: Encapsulation

Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction. RFAZHE7YNFV8

Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods. If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the class. For this reason, encapsulation is also referred to as data hiding.

9/7/11

Java Modifiers Summary

The Modifier class provides static methods and constants to decode class and member access modifiers. The sets of modifiers are represented as integers with distinct bit positions representing different modifiers.
RFAZHE7YNFV8


9/1/11

SortableStack implementation in Java

I am implementing an interface for Stack which will help to push and pop in O(n) time and help in finding the highest, lowest and the middle element in O(1) time.


I will be using Arraylist (since I m using a standard jdk 6 and not some other package) because with using this we can implement the above interface in the least possible time.

8/12/11

Create Linked List using Java

The LinkedList class extends AbstractSequentialList and implements the List interface. It provides a linked-list data structure. It has the two constructors, shown here: RFAZHE7YNFV8
LinkedList( )
LinkedList(Collection c)
The first constructor builds an empty linked list. The second constructor builds a linked list that is initialized with the elements of the collection c.


Create Linked List using C

Introduction

Linked list is one of the fundamental data structures, and can be used to implement other data structures. In alinked list there are different numbers of nodes. Each node is consists of two fields. The first field holds the value or data and the second field holds the reference to the next node or null if the linked list is empty.
image001.gif
Figure: Linked list