JAVA

Object | Java

Real-world objects share two characteristics: they all have state and they all have behavior. For example, dogs have state (name, color, breed, hungry) and dogs have behavior (barking, fetching, and slobbering). Software objects are modeled after real-world objects in that they, too have state and behavior. A software object maintains [...]

2019-08-18T17:52:15+05:30Categories: Programming|Tags: |

Difference between ArrayList and Vector

ArrayList and Vector both implements List interface and maintains insertion order. Differences between ArrayList and Vector classes that are given below. ArrayList Vector ArrayList is not synchronized. Vector is synchronized. ArrayList increments 50% of current array size if number of element exceeds from its capacity. Vector increments 100% means doubles the array size if total number [...]

2017-10-01T14:41:43+05:30Categories: Programming|Tags: |

ArrayList vs LinkedList

ArrayList and LinkedList both implements List interface and maintains insertion order. Both are non synchronized classes. Differences between ArrayList and LinkedList classes that are given below. ArrayList LinkedList ArrayList internally uses dynamic array to store the elements. LinkedList internally uses doubly linked list to store the elements. Manipulation with ArrayList is slow because it internally uses [...]

2019-11-27T17:15:49+05:30Categories: Programming|Tags: , , |

LinkedList in Java

LinkedList is a doubly-linked list implementation of the List and Deque interfaces. LinkedList allows for constant-time insertions or removals using iterators, but only sequential access of elements. In other words, LinkedList can be searched forward and backward but the time it takes to traverse the list is directly proportional to [...]

2017-10-01T14:18:00+05:30Categories: Programming|Tags: |

Collection Interface | Java

Collection (aka container) an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Hierarchy of Collection Framework Important methods of Collection interface boolean add(E e) Ensures that this collection contains the specified element (optional operation). void clear() Removes all [...]

2019-11-27T17:09:23+05:30Categories: Programming|Tags: |

Difference between SE, EE, ME and FX | Java

Introduction There are four platforms of the Java programming language: Java Platform, Standard Edition (Java SE) Java Platform, Enterprise Edition (Java EE) Java Platform, Micro Edition (Java ME) JavaFX All Java platforms consist of a Java Virtual Machine (VM) and an application programming interface (API). The Java Virtual Machine is [...]

2019-11-26T21:41:41+05:30Categories: Programming|Tags: |

ArrayList in Java

Arraylist class implements List interface. It is widely used because of the functionality and flexibility it offers. Most of the developers choose Arraylist over Array as it’s a very good alternative of traditional java arrays. ArrayList is a resizable-array implementation of the List interface. It implements all optional list operations, and permits [...]

2017-09-28T22:06:35+05:30Categories: Programming|Tags: |

Priority Queue | Java

Introduction A priority queue is a special queue where: Every item in the queue has a priority, and Higher-priority items are dequeued before lower-priority items. A priority queue can be implemented using many of the data structures (an array, a linked list, or a binary search tree). However, those data structures do [...]

2019-05-23T23:12:43+05:30Categories: Programming|Tags: |

Stack in Java

A Stack is a data structure where you add elements to the "top" of the stack, and also remove elements from the top again. This is also referred to as the "Last In First Out (LIFO)" principle. Here is a Stack usage example: Stack stack = new Stack(); stack.push("1"); stack.push("2"); [...]

2017-10-01T15:03:24+05:30Categories: Programming|Tags: |

Queue in Java

Introduction Queue interface is a subtype of the java.util.Collection interface. A queue is designed to have elements inserted at the end of the queue, and elements removed from the beginning of the queue. Being a Collection subtype all methods in the Collection interface are also available in the Queue interface. [...]

2018-09-27T22:49:17+05:30Categories: Programming|Tags: |
Go to Top