Tag Archives: core java

Sorting of Array using java.util.Arrays in java

java-logo
Well, There are different ways you can sort your different types of array , i.e. whether int[] , byte[], sort[], String[] or any anoher type of array (custome java object array). In this post, I tried to demonstrate primitive types array sorting by using in-built utility tool i.e. java.util.Arrays class. Or if you have primitive types of array of string, then how can you sort by using java.util.Arrays utility class in java.
Continue reading Sorting of Array using java.util.Arrays in java

Sorting of Stack in Java

Oracle JavaWell, when I heard first time about sorting of stack, I thought why we required to sort of any stack. Initially I thought , this is rubbish and time pass thing, but later point of time, realize this can be interview question. In-fact, most of the interviewer ask this question, how to sort stack in java. I tried to demonstrate the exercise of writing program of sorting stack in java.
Continue reading Sorting of Stack in Java

How to Implement Fixed Size Stack in Java

Oracle JavaStack is ADT type of data structure which has different implementation for different purpose for fulfilling of different contextual requirement. In this article tried to implement how to implement by using fixed size array based implementation. If you want to know something basic about Stack, you can visit What is Stack Data structure.

Continue reading How to Implement Fixed Size Stack in Java

How to Remove Element from List In Java

Oracle Java

I tried to demonstrate how to remove element from List in Java. There might be possibility to asked this question by interviewer in different way in your interview. How to remove any element from List, or its implementation class ArrayList, Vector, LinkedList or CopyOnArrayList. In a day-to-day development, you can found the situation where you have to remove item from List , based on the matching of value. So, you can use the following way in your real life project. If you don’t know how to iterate element from list in java, first visit provided link to understand how to iterate over ArrayList.

Continue reading How to Remove Element from List In Java

Different way to iterate List in Java

Oracle Java
There are different way of traversal of ListArrayList, Vector object in java for getting its values. In day-to-day life, we almost use List with different flavor of created object like AraryList, Vector, LinkedList on every alternate day in java programming language, but way of iteration is different , its depend upon the requirement and the required thing in mind on that point of time.

Continue reading Different way to iterate List in Java

How to remove Entry from HashMap in Java

Oracle Java
Well, sometimes interviewer asked you , how to remove any Entry/record from Map, or its implementation class HashMap, Hashtable, LinkedHashMap or ConcurrentHashMap. In day-to-day development you can found the situation where you have to remove from Map best on the matching of key or value. So you can use the following way in your real life project. I prefer , if you don’t know how to iterate HashMap in java , first go through prior post to understand how to iterate over HashMap.
Continue reading How to remove Entry from HashMap in Java

Different way to iterate Map in Java

Oracle Java
There are different way of traversal of Map HashMap , ConcurrentHashMap object in java for getting key/value pair . In day-to-day life, we almost use Map (either get or put operation) on every alternate day in java programming language. But way of iteration is different , its depend upon the requirement and thing in mind on that point of time. Most of the time while iteration we don’t know the key and its value. we have to iterate over and best on that we usually process.
Continue reading Different way to iterate Map in Java

IS-A Vs HAS-A Relationship in Java

Oracle Java
IS-A (Inheritance) relationship and HAS-A (composition) relationship is the one of the important interview question in core java, design consideration and mostly asked to experience developer to check whether he/she knows basic of design consideration or not. In the object oriented world, re-use is the basic concept and technique either via IS-A (inheritance) or HAS-A ( composition) relationship.

Continue reading IS-A Vs HAS-A Relationship in Java