Sorting by

×

#5 Java Overriding

Java is an object-oriented programming language which strictly adheres to core principles of object-oriented programming – Encapsulation, Inheritance and Polymorphism. Overriding implies writing your own version on top of a default implementation of a method in the parent class. Let us say we have a class ‘Person which’ is extended by class ‘Teacher’ and by…

#4 Understanding “equals” and “hashcode” overrides

The ‘hashcode’ and ‘equals’ method in java is common to all objects in the Java programming language very similar to ‘notify()’ , ‘notifyAll()’ and the ‘toString()’ method. These methods have to be overridden for hash collections to work. The ‘Hashset’ for example is a java collection class used for eliminating duplicate elements. The following post…

#3 Functional Interface in Java

The functional interface in Java 8 stands as a pivotal feature that enables developers to seamlessly blend functional programming with object-oriented programming. Identified by the annotation @FunctionalInterface atop any interface definition, it opens up a world of possibilities. Expanding on this, the java.util.function package offers a range of built-in functional interfaces, further enhancing the capabilities…

#2 Comparing Strings in Java

In this blog I will be talking about comparing strings and understanding the String class in detail. As a start string classes are “immutable and final” by nature. These two attributes of the String class go hand-in-hand. If strings have to be immutable, they need be declared final and vice-versa. A final class cannot be…

#1 Sort Using Comparators

In this blog, I will demonstrate how to efficiently sort a java array list using the java Comparator interface. The Comparable interface in java provides a powerful mechanism for specifying the precise criteria to use when sorting an array list.

Quote of the week

“A man is but a product of his thoughts. What he thinks, he becomes !!!”

~ Mahatma Gandhi