Comparable and Comparator example

Comparable /* Result: Akshay Kumar Prashant Gupta Rajiv Srivastava */ /* ———— Sorting thru Comparator Interface (Custom Sorting) * Implements mandatory Comparator interface */ Comparator: /* Output: * Arvind Kejriwal Arvind Tendulkar Arvind Tripathi */

Rate this:

How to work with Java 6′s NavigableSet and NavigableMap

How to work with Java 6′s NavigableSet and NavigableMap: This is my first published article on  popular site – mkyong.com URL-http://www.mkyong.com/java/how-to-work-with-java-6s-navigableset-and-navigablemap/ Also, writing same article on my blog. Hope it will be helpful for you- Rajiv. You can use latest Java 6′s Collection API to navigate a set and Map collections. These API gives aContinue reading “How to work with Java 6′s NavigableSet and NavigableMap”

Rate this:

Latest Cloud based technology for Java Development- CloudBees

Today, I wanna share about new Cloud based technology for Java Development. The CloudBees PaaS provides middleware on top of IaaS. CloudBees: The Java Cloud Revolution is here – and it’s being led by CloudBees! CloudBees is the only Platform as a Service (PaaS) company focused on moving the entire Java application lifecycle to theContinue reading “Latest Cloud based technology for Java Development- CloudBees”

Rate this:

Difference between mvc1 and mvc2

n MVC-1 architecture (also referred as Model 1), the request is first handled by a JSP, that interacts with a Bean. Here the JSP page may have partial processing logic, although a bulk of processing logic may be handled by the beans that may interact with the database. The JSP in this case in additionContinue reading “Difference between mvc1 and mvc2”

Rate this:

Comparable Interface : Problem while adding object to TreeSet

Nice Article: Comparable Interface : Problem while adding object to TreeSet Can anyone tell me why this code fragment shows me the “ClassCastException”, Using Java 2 1.5 compiler. In the above code Set s=new TreeSet(); Set S which is a TreeSet accepts an object that is very true when developer adds an object new Person(20)Continue reading “Comparable Interface : Problem while adding object to TreeSet”

Rate this:

Why ConcurrentHashMap is better than Hashtable and HashMap ???

ConcurrentHashMap is a pretty ignored class. The class offers a very robust and fast (comparatively, we all know java concurrency isn’t the fastest) method of synchronizing a Map collection. There is no way you can compare the two, one offers synchronized methods to access a map while the other offers no synchronization whatsoever. What mostContinue reading “Why ConcurrentHashMap is better than Hashtable and HashMap ???”

Rate this:

Optimizing SQL Queries

 I have found a nice article on Oracle query optimzation:   D.1 Optimizing Single-Table Queries To improve the performance of a query that selects rows of a table based on a specific column value, create an index on that column. For example, the following query performs better if the NAME column of the EMP table hasContinue reading “Optimizing SQL Queries”

Rate this:

Difference between MongoDB and RDBMS

Why RDBMS (SQL): Frequent CRUD transactions for a limited similar type of data in GBs. It’s good for structured data. This kind of database is tightly structured with schema and perform slower (low latency) with huge growing data. RDBMS performs faster for low amount of data ( in GBs). SQL DBs- Oracle, MySQL, SQLServer etc.Continue reading “Difference between MongoDB and RDBMS”

Rate this:

How to decide usage of Java Collections ???

ArrayList – orderd, fast iteration and fast random access.LinkedList – orderd,fast insertion and deletionHashSet – unsorted, unordered Set. no duplicates and you don’t care about order.LinkedHashSet– orderd, Use this class instead of HashSet when you care about the iteration order.TreeSet– Sorted.HashMap– unsorted, unordered. don’t care about the order.LinkedHashMap– maintains insertion order (or, optionally, access order).Continue reading “How to decide usage of Java Collections ???”

Rate this: