Monday, July 21, 2025

Coursera Plus Discount SALE 2025: 40% Off Now—Just $240 Instead of $360 for 12 Months!

Hello guys, If you're dreaming of advancing your career this summer—especially in the hot fields of AI, LLM Engineering, Agentic AI, Machine Learning, Deep Learning, and more—there’s no better time than now to dive in. For a limited period, Coursera Plus is available at 40% off: just $240 for 12 months (regular price $399). This offer ends July 21, 2025, so time is of the essence.

Here’s why this deal is worth your attention—and how Coursera Plus can help you build job-ready skills that stand out.


1. What is Coursera Plus?

Coursera Plus is an annual subscription that unlocks unlimited access to over 10,000 courses, guided projects, and expert certificates from the world’s top institutions—think universities and companies like Stanford, Google, IBM, Microsoft, and more.

For just $240 per year (instead of $399), you get:

  • Unlimited access to all eligible courses and professional certificates

  • No extra charges—learn at your pace

  • Downloadable materials and mobile access

  • Resume-ready credentials you can showcase on LinkedIn or your CV



2. Why July is the Perfect Time to Start Learning

Summer offers a unique opportunity. With longer days and a slower schedule, it's easier to dedicate focused time to learning something new. And right now, Coursera Plus becomes even more attractive with a 40% discount—fueling that motivation.

Here's how you can make the most of it:

  1. Start a career-boosting track in AI, ML, or Deep Learning

  2. Take certificate paths from Google, IBM, or DeepLearning.AI

  3. Work on resume-building capstone projects

  4. Learn new languages (Python, R) or tools (TensorFlow, PyTorch)

  5. Build lasting habits structured around consistent learning

Here is the link to get your discount - Get Coursera Plus for 40% discount







3. In-Demand Coursera Learning Paths in 2025

Here are some of the most impactful learning paths you can take on Coursera right now to learn AI and LLM Engineering, Machine Learning and Deep Learning as well as Cloud Computing skills. 

๐ŸŽ“ AI & Machine Learning

๐Ÿง  Deep Learning

๐Ÿ’ฌ Natural Language Processing

๐Ÿงช Data Science & Analytics

๐Ÿ”’ AI Ethics & Responsible AI

  • AI for Everyone (DeepLearning.AI) – Understand ethical AI, bias, and model governance

Each path includes video lectures, graded assignments, quizzes, and often a hands-on capstone—perfect for building a portfolio recruiters love.




4. What You Get with Coursera Plus

Here are all the things you will get with Coursera Plus subscription:
  • Complete Access: Learn everything without worrying about extra costs

  • Professional Certificates: Earn credentials from industry leaders and universities

  • Downloadable Content: Study offline on-the-go

  • Diverse Learning Formats: Guided projects, self-paced courses, specialization tracks

  • Flexible Deadlines: Set your own study pace

  • Resume & Portfolio Fit: Build real-world projects you can showcase



5. Real Outcomes from Learners

Coursera learners regularly land roles at top tech companies. 

Here are some success stories:

  • Swati, a summer learner, says: “With Coursera Plus, I earned TensorFlow and ML certifications, which helped me land a data scientist role at a fintech startup.”

  • Rohan, a software engineer, shares: “I used Coursera Plus to build an NLP resume parser project in natural language courses—and it was a standout piece in my LinkedIn portfolio.”

  • Priya, a fresh graduate: “The AI Specialization by DeepLearning.AI helped me understand bias in models and I implemented fairness metrics in my capstone project.”

You can find more such success stories on Coursera itself.


6. Is Coursera Plus Worth It?

Absolutely—especially with the 40% discount:

  • Regular annual price: $399

  • Discounted price: $240

  • You access: 10,000+ courses + certificates from top institutions

  • ROI: Gain skills worth $1,000s if bought separately

Coursera Plus is ideal for those looking to do multiple courses, earn several certificates, or build a comprehensive multi-track portfolio. But don’t wait—the discounted subscription ends July 21, 2025!



7. How to Make Your Learning Journey Count

Here are tips to make full use of your Coursera Plus subscription:
  1. Define Your Goal: Decide whether you’re aiming for AI engineering, data science, cloud specialization, or ML research.

  2. Map Your Path: Choose 2–3 Specializations or Professional Certificates that align with your goal.

  3. Structure Your Time: Block 4–6 hours per week during the summer months for consistent progress.

  4. Build Projects: Take guided projects or capstones that create materials you can put in your portfolio.

  5. Publish & Network: Upload projects to GitHub, write summary posts or LinkedIn updates, engage in online communities.

  6. Prepare for Interviews: Use certificates and projects to showcase technical depth in job applications.



8. What to Do Next


๐Ÿ”ฅ Bottom Line

With Coursera Plus at 40% off, summer 2025 is your best shot at building job-ready skills in AI, ML, Deep Learning, and more. For just $240, you get high-quality courses, expert guidance, certificates, and downloadable materials—everything to accelerate your career.

Don’t wait—the offer ends July 21. Start your journey today and be ready for the next wave of AI-powered innovation.


๐Ÿ‘‰ Ready to begin?
Get Coursera Plus for $240 (annual subscription)

    Saturday, July 19, 2025

    Top 10 SQL Queries from Technical Interviews to Learn Window Functions like ROW_NUMBER

    Hello guys, If you're preparing for SQL interviews or working on real-world reporting tasks, mastering window functions is no longer optional. They are one of the most powerful tools in SQL which allows you to perform calculations across rows related to the current row without collapsing your result set like GROUP BY does. Window functions like ROW_NUMBER(), RANK(), LEAD(), LAG(), and SUM() OVER help you write cleaner, faster, and more expressive queries—ideal for performance tuning and analytical processing.

    Let’s dive into the Top 10 SQL window function queries that you must know.

    What is PriorityQueue or priority queue in Java with Example - Tutorial

    PriorityQueue is an unbounded Queue implementation in Java, which is based on a priority heap. PriorityQueue allows you to keep elements in a particular order, according to their natural order or custom order defined by the Comparator interface in Java. Head of priority queue data structure will always contain the least element with respect to specified ordering. For example, in this post, we will create a PriorityQueue of Items, which are ordered based upon their price, this will allow us to process Items, starting from the lowest price. A priority queue is also very useful in implementing the Dijkstra algorithm in Java. You can use to PriorityQueue to keep unsettled nodes for processing.

    What is EnumMap in Java – Example Tutorial

    What is EnumMap in Java
    EnumMap in Java is added on JDK  5 release along with other important features like  Autoboxing, varargs, and Generics. EnumMap is a specialized Map implementation designed and optimized for using Java Enum as key. Since enum can represent a type (like class or interface)  in Java and it can also override equals() and hashCode(), It can be used inside HashMap or any other collection but using  EnumMap brings implementation-specific benefits which are done for enum keys, In short EnumMap is optimized Map implementation exclusively for enum keys. As per Javadoc Enum is implemented using Arrays and common operations result in constant time.

    How to use CopyOnWriteArraySet in Java with Example

    CopyOnWriteArraySet is little brother of CopyOnWriteArrayList class. These are special purpose collection classes which was added on JDK 1.5, along with their most popular cousin ConcurrentHashMap. They are part of concurrent collection framework and reside in java.util.concurrent package. CopyOnWriteArraySet is best suited as a read-only collection whose size is small enough to copy if some mutative operation happens, for example, you can use CopyOnWriteArraySet to store objects at the start-up of the application and let multiple application thread access them during application life time. If an new condition or object comes up during that time, it can also be added into this Set, with incurring cost of creating a new array.

    2 Example to Merge or Join Multiple List in Java - Tutorial

    Sometimes, we need to merge multiple lists into one before performing any operation, say Iteration or transformation. It's quite common to merge two lists, or combine them into a bigger list and there are multiple ways to do it. In this article, we will take a look at two simple way to join two lists in Java, you can further extend that idea to join any number of List or it's implementation e.g. ArrayList or LinkedList in Java. One way to merge multiple lists is by using addAll() method of java.util.Collection class, which allows you to add the content of one List into another List. By using the addAll() method you can add contents from as many List as you want, it's the best way to combine multiple List.

    How to Create Read Only List, Map and Set in Java? UnModifiable Collection Example

    Read-only List, Map and Set in Java
    A read-only List means a List where you can not perform modification operations like add, remove or set. You can only read from the List by using the get method or by using the Iterator of List, This kind of List is good for a certain requirement where parameters are final and can not be changed. In Java, you can use Collections.unModifiableList() method to create read-only List, Collections.unmodifiableSet() for creating read-only Set like read-only HashSet and similarly creating a read-only Map in Java, as shown in below example. Any modification in the read-only List will result in java.lang.UnSupportedOperationException in Java.  

    Friday, July 18, 2025

    Top 6 AI and Prompt Engineering Books for Software Engineers in 2025

    Hello guys, AI and Large Language Models (LLMs) are transforming the software engineering landscape. While many developers use tools like ChatGPT or GitHub Copilot, understanding the engineering principles behind them is essential to stay relevant in 2025 and beyond.  While there are many resources to learn about AI Engineering, Prompt Engineering and LLM Engineering, and I have also shared online courses and roadmap, books offer structured and in-depth learning that videos and blogs often lack. They are often created by true experts and authorities who have done a lot of research in that area and that's why I always include book in my learning process.

    How to use ConcurrentHashMap in Java - Example Tutorial and Working

    ConcurrentHashMap in Java is introduced as an alternative of Hashtable in Java 1.5 as part of the Java concurrency package. Prior to Java 1.5 if you need a Map implementation, which can be safely used in a concurrent and multi-threaded Java program, then, you only have Hashtable or synchronized Map because HashMap is not thread-safe. With ConcurrentHashMap, now you have a better choice; because not only it can be safely used in the concurrent multi-threaded environment but also provides better performance over Hashtable and synchronizedMap.

    How to use EnumSet in Java with Example

    EnumSet is one of the specialized implementations of the Set interface for an enumeration type, introduced in Java 1.5 along with the enumeration type itself. Programmer often stores Enum into common collection classes e.g. HashSet or ArrayList, mostly because they are unaware of this little gem. Even I wasn't aware of this class a few years ago until I come across one of the finest books for Java programmers, Effective Java. It has an Item on EnumSet, which highlights some typical use-cases for this collection class instead of using int variable and bitwise operator. Since Enum constants are unique and have pre-defined lengths, as you can not define a new enum constant at runtime; it allows Java API designers to highly optimize EnumSet.

    What is difference between Enumeration and Iterator in Java? Answer

    Though both Iterator and Enumeration allows you to traverse over elements of Collections in Java, there is some significant difference between them e.g. Iterator also allows you to remove elements from the collection during traversal but Enumeration doesn't allow that, it doesn't get remove() method. Enumeration is also a legacy class and not all Collection supports it e.g. Vector supports Enumeration but ArrayList doesn't. On the other hand, Iterator is the standard class for iteration and traversal. By the way,  what is the difference between Enumeration and Iterator in Java? 

    Top 11 Java ConcurrentHashMap Interview Questions with Answers [UPDATED]

    The ConcurrentHashMap class part of concurrent collections package added on JDK 1.5 which contains utility classes like BlockingQueue, CopyOnWriteArrayList, CopyOnWriteArraySet etc. It is a replacement of synchronized hash-based map implementations e.g. Hashtable and synchronized HashMap. It implements Map and ConcurrentMap (a sub-interface of Map) interface which allows you to store key-value pairs. The class is similar to HashMap or Hashtable but it's more scalable and the right fit for concurrent Java application. Unlike Hashtable which achieves its thread-safety by compromising the scalability, ConcurrentHashMap uses advanced techniques e.g. dividing the map into segments to remain thread-safe and scalable at the same time.

    Wednesday, July 16, 2025

    How HashMap works in Java?

    Hello guys, if you are looking for an answer of popular Java interview question, how HashMap works in Java? or How HashMap works internally in Java then you have come to the right place. In this article, I will not just answer those question but also many related questions like How get() and put() method works in Java? what role equals() and hashcode() play in HashMap, How HashMap resize itself, and why key object of HashMap should be Immutable in Java. Let's start with the basics first. HashMap in Java works on hashing principles. It is a data structure that allows us to store object and retrieve it in constant time O(1) provided we know the key. Also this is one of my most popular article with more than 6 million views and I have now updated it to include latest information like how HashMap now uses a balanced tree instead of linked list for storing collision objects and new diagrams on HashMap working which provide visual explanations. 

    Difference between fail-safe vs fail-fast Iterator in Java? Example

    The difference between fail-safe and fail-fast Iterator is becoming favorite core java interview questions day by day, the reason it touches concurrency a bit, and the interviewee can go deep on it to ask how fail-safe or fail-fast behavior is implementedIn this article, we will see what are fail-safe and fail-fast iterators in java and the differences between fail-fast and fail-safe iterators. The concept of the fail-safe iterator is relatively new in Java and was first introduced with Concurrent Collections in Java 5 like ConcurrentHashMap and CopyOnWriteArrayList.

    Difference between List and Set in Java Collection? Example

    What is the difference between List and Set in Java is a very popular Java collection interview question and an important fundamental concept to remember while using the Collections class in Java. Both List and Set are two of the most important Collection classes Java Program use along with various Map implementations. The basic feature of List and Set are abstracted in the List and Set interface in Java and then various implementations of List and Set adds specific features on top of that e.g. ArrayList in Java is a List implementation backed by Array while LinkedList is another List implementation that works like linked list data-structure.

    Difference between ArrayList and Vector in Java

    ArrayList and Vector are two of the most used classes on the java collection package and the difference between Vector and ArrayList is one of the most frequently asked java interview questions on first-round or phone interviews. Though it’s quite a simple question in my opinion but knowledge of when to use Vector over ArrayList or does matter if you are working on a project. In this article, we will some point-based differences between Vector and ArrayList in Java and trying to understand the concept behind those differences. 

    Tuesday, July 15, 2025

    What is difference between HashMap and Hashtable in Java?

    HashMap vs Hashtable in Java
    Though both Hashtable and HashMap are data-structure based upon hashing and implementation of Map interface, the main difference between them is that HashMap is not thread-safe but Hashtable is thread-safe. This means you cannot use HashMap in a multi-threaded Java application without external synchronization. Another difference is HashMap allows one null key and null values but Hashtable doesn't allow null key or values. Also, the thread-safety of the hash table is achieved using internal synchronization, which makes it slower than HashMap.

    Difference between LinkedList and ArrayList in Java

    LinkedList and ArrayList both implement List Interface but how they work internally is where the differences lie. The main difference between ArrayList and LinkedList is that ArrayList is implemented using a resizable array while LinkedList is implemented using doubly LinkedList. ArrayList is more popular among Java programmers than LinkedList as there are few scenarios on which LinkedList is a suitable collection than ArrayList. In this article, we will see some differences between LinkedList and ArrayList and try to find out when and where to use LinkedList over ArrayList.

    Difference between TreeSet, LinkedHashSet and HashSet in Java with Example

    TreeSet, LinkedHashSet, and HashSet all are implementation of the Set interface and by virtue of that, they follow the contract of Set interface i.e. they do not allow duplicate elements. Despite being from the same type of hierarchy,  there are a lot of differences between them; which is important to understand, so that you can choose the most appropriate Set implementation based upon your requirement. By the way difference between TreeSet and HashSet or LinkedHashSet is also one of the popular Java Collection interview questions, not as popular as Hashtable vs HashMap or ArrayList vs Vector but still appears in various Java interviews.

    Difference between PriorityQueue and TreeSet in Java? Example

    The PriorityQueue and TreeSet collection classes have a lot of similarities e.g. both provide O(log(N)) time complexity for adding, removing, and searching elements, both are non-synchronized and you can get elements from both PriorityQueue and TreeSet in sorted order, but there is a fundamental difference between them, TreeSet is a Set and doesn't allow a duplicate element, while PriorityQueue is a queue and doesn't have such restriction. It can contain multiple elements with equal values and in that case head of the queue will be arbitrarily chosen from them.

    Difference between Synchronized and Concurrent Collections in Java? Answer

    Synchronized vs Concurrent Collections
    Though both Synchronized and Concurrent Collection classes provide thread-safety, the differences between them come in performance, scalability, and how they achieve thread-safety. Synchronized collections like synchronized HashMap, Hashtable, HashSet, Vector, and synchronized ArrayList are much slower than their concurrent counterparts like ConcurrentHashMap, CopyOnWriteArrayList, and CopyOnWriteHashSet. The main reason for this slowness is locking; synchronized collections lock the whole collection e.g. whole Map or List while concurrent collection never locks the whole Map or List.

    How to choose the Right Collection Class in Java? List, Set, Map, and Queue Example

    The Java collection framework offers implementation of different data structure like an array, list, set, map, queue, tree, etc and the choice really depends upon the situation and properties of the different data structure. For example, if your requirement is fast search with index then you can use ArrayList and if you want to store key-value pairs then you would consider using hash table data structure and there are a couple of implementation of hash table data structure in Java, like HashMap, Hashtable, LinkedHashMap, TreeMap, and ConcurrentHashMap. Now, which one will you choose? If you don't know or confused don't worry, I will give you a set of rules and use cases which will help you choose the right Collection type in Java depending upon scenario. 

    Monday, July 14, 2025

    Difference between HashMap, LinkedHashMap and TreeMap in Java with Example

    Hello guys, if you are wondering what is difference between HashMap, TreeMap, and LinkedHashMap in Java and when to use them then you are at the right place. In past, I have shared frequently asked HashMap Interview questions and ConcurrentHashMAp Interview questions and today, I Will answer this question in detail. The java.util.Map is one of the most important interfaces from the Java Collection Framework.  It provides hash table data structure functionality by its implementations like HashMap, Hashtable, LinkedHashMap, and a little bit of sorting with the TreeMap. So if you are looking to store key-value pairs in the Java program,  you have a wide range of choices available depending upon your requirement. The main difference between LinkedHashMap, TreeMap, and HashMap comes in their internal implementation and specific features, which a Java programmer should know to use them effectively. 

    How to get Key From Value in Hashtable, HashMap in Java? Example

    It's not easy to get key from the value in Hashtable or HashMap, as compared to getting value from key because HashMap or Hashtable doesn't enforce one to one mapping between key and value inside Map in Java. in fact, Map allows the same value to be mapped to multiple keys inside HashMap, Hashtable, or any other Map implementation. What you have in your kitty is Hashtable.containsValue(String value) or Hashtable.containsKey(String key) to check whether key or value exists in HashMap or not, but sometimes we want to retrieve a value from Map corresponding to any key and there is no API method to do in Map.

    Difference between HashMap and IdentityHashMap in Java? Example

    Hello guys, if you are wondering what is differnece between an HashMap and IdentiyHashMap in Java then you are at right place. IdentityHashMap in Java was added in Java 1.4 but still, it's one of those lesser-known classes in Java. The main difference between IdentityHashMap and HashMap in Java is that IdentityHashMap is a special implementation of Map interface which doesn't use equals() and hashCode() method for comparing objects unlike other implementations of Map e.g. HashMap. Instead, IdentityHashMap uses the equality operator "=="  to compare keys and values in Java which makes it faster compared to HashMap and suitable where you need reference equality check and instead of logical equality.

    What is difference between ArrayList and ArrayList<?> in Java?- Raw Type vs Wildcard Example Tutorial

    One of my readers asked me about the difference between ArrayList vs ArrayList< in Java?>, which was actually asked to him in a recent Java development interview. The key difference between them is that ArrayList is not using Generics while ArrayList is a generic ArrayList but they look very similar. If a method accepts ArrayList or ArrayList<?> as a parameter then it can accept any type of ArrayList like ArrayList of String, Integer, Date, or Object, but if you look closely you will find that one is raw type while the other is using an unbounded wildcard. What difference that could make? Well, that makes a significant difference because ArrayList with raw type is not type-safe but ArrayList<?> with the unbounded wildcard is type-safe.

    How to Filter Stream and Collections in Java 8? Example Tutorial

    Java 8 provides excellent features to support the filtering of elements in Java Collections. Prior to Java 8, the only better way to filter elements is by using a foreach loop or iterating over Collection using the Iterator and selecting the required object, leaving out rest. Though that approach work, it was very difficult to run them in parallel and take advantage of multiple CPUs available in modern-day servers. Java 8 provides Streams, which not only makes it easy to run any operation parallel but also supports lazy loading and lazy evaluation, which means as soon as the filtering condition is satisfied, it stooped doing work, doesn't matter how many objects the collection contains.

    Top 25 Java Collection Framework Interview Questions Answers for Freshers and Experienced Programmers

    Interview questions from the Collection package or framework are most common in any Core Java Interview yet a tricky one. Together Collection and multithreading make any Java interview tough to crack and having a good understanding of Collection and threads will help you to excel in Java interviews. I thought about writing interview questions on the Java collection framework and important classes like ArrayList, HashMap, Hashtable, and newly added concurrent collections e.g. ConcurrentHashMap when I first wrote 10 multi-threading Interview questions but somehow this article got delayed. Though I have shared several questions individually in between.

    How to Convert Collection to String in Java - Spring Framework Example

    How to convert Collection to String in Java
    Many times we need to convert any Collection like Set or List into String like comma-separated or any other delimiter delimited String. Though this is quite a trivial job for a Java programmer as you just need to Iterate through the loop and create a big String where individual String are separated by a delimiter, you still need to handle cases like the last element should not have a delimiter or at a bare minimum, you need to test that code.

    How does Java HashMap or LinkedHahsMap handles collisions?

    Prior to Java 8, HashMap and all other hash table based Map implementation classes in Java handle collision by chaining, i.e. they use linked list to store map entries which ended in the same bucket due to a collision. If a key end up in the same bucket location where entry is already stored then this entry is just added at the head of the linked list there. In the worst case this degrades the performance of the get() method of HashMap to O(n) from O(1). In order to address this issue in the case of frequent HashMap collisions, Java8 has started using a balanced tree instead of a linked list for storing collided entries. This also means that in the worst case you will get a performance boost from O(n) to O(log n).

    Difference between HashMap and HashSet in Java

    HashMap vs HashSet is the most frequently asked question during any core java interview and the interview is not said completed until they will not cover the Collection Framework and multi-threading interview and collections are uncompleted without Covering Hash Set and HashMap.
    Both HashMap and HashSet are part of the collection framework which allows us to work with a collection of objects. Collection Framework has its own interfaces and implementation classes. Basically, a collection is divided into Set Interface, List, and Queue Interfaces.

    Difference between EnumMap and HashMap in Java? Example

    HashMap vs EnumMap in Java
    What is the difference between EnumMap and HashMap in Java is the latest Java collection interview question which has been asked to a couple of my friends? This is one of the tricky Java questions, especially if you are not very much familiar with EnumMap in Java, which is not uncommon, given you can use it with only Enum keys. The main difference between EnumMap and HashMap is that EnumMap is a specialized Map implementation exclusively for Enum as key. Using Enum as a key allows doing some implementation level optimization for high performance which is generally not possible with other objects as key.

    Difference between ConcurrentHashMap, Hashtable and Synchronized Map in Java

    ConcurrentHashMap vs Hashtable vs Synchronized Map
    Though all three collection classes are thread-safe and can be used in multi-threaded, concurrent Java application, there is a significant difference between them, which arise from the fact that how they achieve their thread-safety. Hashtable is a legacy class from JDK 1.1 itself, which uses synchronized methods to achieve thread safety. All methods of Hashtable are synchronized which makes them quite slow due to contention if a number of thread increases. Synchronized Map is also not very different than Hashtable and provides similar performance in concurrent Java programs. The only difference between Hashtable and Synchronized Map is that later is not a legacy and you can wrap any Map to create it's synchronized version by using Collections.synchronizedMap() method.

    How to Iterate through ConcurrentHashMap and print all keys and values in Java? Example

    Suppose you have a ConcurrentHashMap of String and Integer and you want to print all keys and values, how do you do that? This is a common, day-to-day programming task for Java programmers and there are many ways to do it. The Map interface provides several view methods e.g. keySet(), values(), and entrySet() to retrieve all keys, values, and all key and value pairs as entries. You can use respective methods to print all keys, all values, or all key values pairs. For printing, you also have multiple choices like you can either use enhanced for loop or Iterator, though later also provide you the facility to remove key-value pairs while printing if needed.

    Saturday, July 12, 2025

    Enhanced For Loop Example and Puzzle in Java

    From Java 5 onwards, we have a for-each loop for iterating over collection and array in Java. For each loop allows you to traverse over collection without keeping track of index like traditional for loop, or calling hasNext() method in while loop using Iterator or ListIterator. For-each loop indeed simplified iteration over any Collection or array in Java, but not every Java programmer is aware of some useful details of the for-each loop, which we will see in this tutorial. Unlike other popular items from Java 5 release alias Generics, Autoboxing, and variable arguments, Java developers tend to use for-each loop more often than any other feature, but when asked about how does advanced foreach loop works or what is a basic requirement of using a Collection in the for-each loop, not everyone can answer.

    JUnit4 Annotations : Test Examples and Tutorial

    JUnit4 Annotations are a single big change from JUnit 3 to JUnit 4 which is introduced in Java 5. With annotations creating and running a JUnit test becomes easier and more readable, but you can only take full advantage of JUnit4 if you know the correct meaning of annotations used on this version and how to use them while writing tests. In this
    Junit tutorial we will not only understand the meaning of those annotations but also we will see examples of JUnit4 annotations. By the way, this is my first post in unit testing but if you are new here than you may like post 10 tips to write better code comments and 10 Object-oriented design principles for Programmer as well.

    JUnit Testing Tips - Constructor is Called Before Executing Test Methods? Example

    Even though almost all Java programmers either use JUnit or TestNG for their unit testing need along with some mock object generation libraries e.g. Mockito, but not everyone spends time and effort to learn subtle details of these testing libraries, at least not in proportion to any popular framework like Spring or Hibernate. In this blog post, I am sharing one of such detail, which has puzzled me a couple of years ago. At that time, though I had been using JUnit for a significant time, I wasn't aware that code written inside the constructor of the Test class is executed before each test method.

    How to Fix Exception in thread "main" java.lang.NoClassDefFoundError: Running Java from Command line

    The "Exception in thread "main" java.lang.NoClassDefFoundError: helloworldapp/HelloWorldApp" error comes when you are trying to run the HelloWorldApp Java program from the command line but either .class file is not there or Java is not able to find the class file due to incorrect classpath settings. The name of the class could be different in each case, it depends upon which class you are passing to java command for running from the command prompt. Another interesting thing to remember is that this error only comes in Java version less than or equal to Java 6 like Java 1.5 or Java 1.4, if you are running in JDK 7 or Java 8 instead of this you will see "Error: could not able to find or load class HelloWorldApp". Technically, both errors come due to some reason and their solution is also exactly the same.

    How to fix java.io.NotSerializableException: org.apache.log4j.Logger Error in Java? Example

    java.io.NotSerializableException: org.apache.log4j.Logger error says that an instance of org.apache.lo4j.Logger is not Serializable. This error comes when we use log4j for logging in Java and create Logger in a Serializable class e.g. any domain class or POJO which we want to store in HttpSession or want to serialize it. As we know from 10 Java Serialization interview question that, if you have a non serializable class as member in a Serializable class, it will throw java.io.NotSerializableException Exception.

    Binary Search vs Contains Performance in Java List - Example

    There are two ways to search an element in a List class, by using contains() method or by using Collections.binarySearch() method. There are two versions of binarySearch() method, one which takes a List and Comparator and other which takes a List and Comparable. This method searches the specified list for the specified object using the binary search algorithm. The list must be sorted into ascending order according to the natural ordering of its elements (as by the sort(List) method) prior to making this call. If List is not sorted, then results are undefined. If the List contains multiple elements equal to the specified object, there is no guarantee which one will be returned. This method runs in log(n) time for a "random access" list (which provides near-constant-time positional access).

    How to Fix Eclipse No Java Virtual Machine was found Windows JRE JDK 64 32 bit Error? Example

    One of my readers was installing Eclipse in his Windows 7 x86 machine and emailed me about this error "A java Runtime Environment (JRE) or Java Development kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found". Before getting into details and trying to find root cause and solution of Eclipse Java Virtual Machine not found error, let's see some background about Eclipse. Eclipse is a popular Java IDE, which assists on coding, debugging and running Java program, but the key point is, Eclipse itself need Java to launch and run.

    Private in Java: Why should you always keep fields and methods private? Example

    Making members private in Java is one of best coding practice. Private members (both fields and methods) are only accessible inside the class they are declared or inside inner classes. private keyword is one of four access modifier  provided by Java and its a most restrictive among all four e.g. public, default(package), protected and private. Though there is no access modifier called package, rather its a default access level provided by Java. In this Java tutorial we will see why should we always make members of class by default as private and answer to one of popular Java interview question can override private methods in Java.

    Friday, July 11, 2025

    Introduction of How Android Works for Java Programmers

    Android development is a popular buzz in the Java programming world. It's Android, which keeps Java at the forefront of the last couple of years. Now, How important is it to understand or learn Android for Java programmers? Well, it depends on, if you like application development and wants to reach a mass, Android offers that opportunity to you. Millions of Android phones are available and they keep increasing, with pace, much higher than iPhone or iOS. What all this means is, it does make a lot of sense to learn Android programming for Java programmers, and this article is about that, but this is also one of the good reasons to learn Java programming. This tutorial will give you a basic idea of How Android works? not detailed but a good overview.

    10 Essential UTF-8 and UTF-16 Character Encoding Concepts Every Programmer Should Learn

    Hello guys, if you want to learn about character encoding, particularly UTF-18 and UTF-16, and looking for a good resource then you have come to the right place. In this article, I am going to discuss 10 important points about UTF-8 and UTF-16 character encoding which I believe every programmer should learn. This is one of the fundamental topics to which many programmers don't pay attention unless they face issues related to character encoding. Knowing how a character is stored and how they are represented in such a way what computer can understand is very important in this age of globalization and internationalization where you need to store and work through data that contains characters from multiple languages. 

    Top 5 Blogs Java EE developers should follow

    One reason for Java's great success as a programming language is that it has dominated the Enterprise space. Earlier J2EE used to be the popular platform, but now we have a more modern and improved Java EE platform or Jakarta EE. Java Platform, Enterprise Edition 7 provides new features that include enhanced HTML5 support, increases developer productivity, and further improves how enterprise demands can be met. One of the biggest advantages of Java EE 7 is the reduction of boilerplate code.

    5 Entertaining Posts from StackOverFlow - Must Read

    StackOverFlow is great place to look for help, learn and participate, but it's also a great place to taste some real entertainment, contributed by programmers from all over the world. Though, due to strict policies of stackoverflow.com, most of the entertaining post either are either gets closed or deleted, some of them remained to entertain programming community. Being a regular reader of StackOverFlow from long time, I have found couple of threads which are truly amazing, and has lot's of funny and entertaining content. Here I am going to share 5 of my favorite StackOverFlow posts, which I suggest you to read, if you get bored or you have some time to kill. By the way, don't forget to leave comments and let us know which is your favorite funny and entertaining threads in StackOverFlow.

    Wednesday, July 9, 2025

    5 Things Programmers Can Buy in Amazon Prime Day 2025 [Best Deals]

    Hello guys, many of my friends and colleagues used to wait until November to buy books, gadgets, and other computer items to get the huge discount offered on Black Friday and Cyber Monday deals, but you don't need to wait that long. Amazon is bringing Black Friday to the summer with its annual Prime Day offers. The Amazon Prime day is nothing but a one-day (precisely one and half-day and this time full two-day) shopping extravaganza, where you will get huge discounts on thousands of Amazon products including books, games, gadgets, and other computer and electronics items. So, if you are looking to buy a new laptop, a new smartphone, or some fitness gadgets and watch then this is an awesome opportunity. 

    Tomcat – java.lang.OutOfMemoryError: PermGen space Cause and Solution

    Tomcat web server often suffers from java.lang.OutOfMemoryError: PermGen space whenever you deploy and un-deploy your web application a couple of times. No matter you are using tomcat6, tomcat7, or using bundled tomcat in Netbeans or Eclipse you will face this error now and then while developing web application on tomcat server. I thought about this article after writing 2 Solution of OutOfMemoryError in Java. I have touched this issue there but then I thought to write a separate tutorial for tomcat outofmemoryerror because I am getting this error too frequently.

    How to fix java.lang.classcastexception cannot be cast to in Java - cause and solution

    As name suggests ClassCastException in Java comes when we try to type cast an object and object is not of the type we are trying to cast into. In fact ClassCastException in Java is one of most common exception in Java along with java.lang.OutOfMemoryError and ClassNotFoundException in Java before Generics was introduced in Java 5 to avoid frequent instances of java.lang.classcastexception cannot be cast to while working with Collection classes like ArrayList and HashMap, which were not type-safe before Java 5. Though we can minimize and avoid java.lang.ClassCastException in Java by using Generics and writing type-safe parameterized classes and method, its good to know real cause of ClassCastException and How to solve it.

    How to Fix java.lang.OutOfMemoryError: GC overhead limit exceeded ? Example Solution

    The java.lang.OutOfMemoryError: GC overhead limit exceeded is another type of OutOfMemoryError in Java which comes when JVM spent too much time doing garbage collection without any success.  For example, if almost 98% of CPU for a Java process is busy doing GC and reclaims very less amount of Java heap space around 2%, then JVM throws "java.lang.OutOfMemoryError: GC overhead limit exceeded" error. Though, the definition of 98% CPU time may vary between different Garbage collectors and different JVM versions.  

    What is Assertion in Java - Java Assertion Tutorial Example

    Java Assertion or assert keyword in Java is a little unknown and not many programmers are familiar with this and it's been rarely used especially if you have not written a unit test using JUnit which extensively uses Java assertion to compare test result. JUnit itself is the biggest manifestation of what assertion in Java can do and believe me by using assertion along with Exception you can write robust code. Assertion not only improves the stability of code but also help you to become a better programmer by forcing you to think about different scenario while writing production-quality code and improving your think through ability.

    What is the use of java.lang.Class in Java? Example

    java.lang.Class is one of the most important classes in java but mostly overlooked by Java developers. It is very useful in the sense that it provides several utility methods like getClass(), forName() which is used to find and load a class, you might have used to load Oracle or MySQL drivers. It also provides methods like Class.newInstance() which is the backbone of reflection and allows you to create an instance of a class without using a new() operator.  The class has no public constructor and its instance is created by JVM when a class is loaded.

    Java Mistake 1 - Using float and double for monetary or financial calculation Example

    Java is considered a very safe programming language compared to C and C++ as it doesn't have free() and malloc() to directly do memory allocation and deallocation, You don't need to worry about array overrun in Java as they are bounded and there is NO pointer arithmetic in Java. Still, there are some sharp edges in the Java programming language that you need to be aware of while writing enterprise applications. Many of us make a subtle mistake in Java which looks correct in the first place but turns out to be buggy when looked at carefully. In this series of java articles, I will be sharing some common Java mistakes programmers make while programming applications in Java.

    Top 10 EJB Interview Question and Answer asked in Java J2EE Interviews

    10 EJB Interview Questions and Answer from my collection of interview questions. I have been sharing interview questions on various topics like Singleton interview questions, serialization interview questions, and most recently Spring interview questions. No doubt these questions are very important for performing better in J2EE and EJB interviews but also they open a new path for learning as you may find some concepts new even while revising your knowledge in EJB. EJB interviews have always been tough because its difficult to find people who have hands-on experience on Enterprise Java Beans (EJB) and most of the guys either have worked only on sample projects and are not aware of critical functionalities like distributed transaction management, container-managed persistence, and various other services which EJB provides.

    How to get and set default Character encoding or Charset in Java? Example

    Default Character encoding in Java or charset is the character encoding used by JVM to convert bytes into Strings or characters when you don't define java system property "file.encoding". Java gets character encoding by calling System.getProperty("file.encoding","UTF-8") at the time of JVM start-up. So if Java doesn't get any file.encoding attribute it uses "UTF-8" character encoding for all practical purpose e.g. on String.getBytes() or Charset.defaultCharSet()