Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
Preparing for Java and Spring Boot Interview?
3 Difference between Web Server vs Application Server vs Servlet Containers - Apache vs JBoss vs Tomcat
Top 10 Microservices Design Principles with Examples
10 Examples of Comparator, Comparable, and Sorting in Java 8
Hello guys, the Comparator class is used to provide code or logic for comparing objects in Java, while sorting a list of objects or a collection of objects. It's close cousin of Comparable which provides natural order sorting e.g. ascending and descending orders for numbers like int, short, long or float, and lexicographic order for String i.e. the order on which words are arranged in dictionaries. The Comparators are used while sorting arrays, lists and collections. You pass logic to compare objects and sorting methods like Collections.sort() use that logic to compare elements until they are arranged in sorted order.
How to Convert String to LocalDate, LocalTime, LocalDateTime and ZonedDateTime in Java? Example Tutorial
The JDK 8 added a new Date and Time API (JSR 310) which introduces new date and time classes like LocalDate, LocalTime, LocalDateTime, and ZonedDateTime. Now, if you have a String e.g. "2016-12-14 03:30" then how do parse it to LocalDate, LocalTime, LocalDateTime and ZonedDateTime? Similarly, if you have an instance of those classes how you can format to the String you want e.g. in dd/MM/yyyy format, or USA or UK format? Well, Java 8 provides a utility class called DateTimeFormatter which can be used to parse/format dates in Java 8. It also provides several built-in formatter e.g. ISO date format and other to facilitate formatting of dates to String.
How to convert JSON to Map in Java 8 without using third party libraries like Jackson or Gson
Hello guys, If you are working with JSON data then you may know that JSON is collection of key value pairs and that's why many times, you also need to convert them into a Map in Java. While there are many Java libraries like Jackson and Gson which provides support of parsing JSON to Java objects, there is not much support for JSON parsing or manipulation on standard JDK. While JSON parsing is still a long overdue, starting with JDK 8u60+ the built-in Nashorn engine is capable to convert JSON content into java.util.Map. No external dependencies are required for parsing JSON in to Map as you will learn in this article.
Top 10 Online Courses to Learn Python in 2024 - Best of Lot
Can You Override static method in Java? Method Hiding Example
Top 95 Programming Interview Questions Answers to Crack Any Coding Job Interview
Top 5 Free Object-Oriented Programming Courses for Java Programmers in 2024 [UPDATED]
Top 10 Free Courses for Java Developers to Learn Online in 2024 - Best of Lot
Top 30 Stack and Queue Data Structure Interview Questions for Practice
Top 5 Java Performance Courses for Experienced Developers in 2024 - Best of Lot
Top 7 Free Amazon Web Services or AWS Courses to Learn in 2024- Best of Lot [UPDATED]
Top 10 Online Courses to Learn Data Structure and Algorithms in 2024 - Best of Lot
Top 10 Free Core Spring, Spring MVC, and Spring Boot Courses for Beginners in 2024 - Best of Lot
Top 5 System Design Newsletter You Can Read in 2024
8 Free Linux Courses for Programmers and IT Professionals to Learn Online [2024]
Top 10 JavaScript Online Courses for Beginners in 2024 - Best of Lot
Hello guys, JavaScript is one of the most powerful programming languages, and if you want to learn JavaScript, now is the best time. If you are looking for the best and advanced JavaScript courses, then you have come to the right place. Earlier, I have shared JavaScript websites, JavaScript projects, and free JavaScript courses, and in this article, I am going to share some of the best courses to learn JavaScript in 2024. I have compiled this list by collecting a lot of recommended JavaScript courses from online learning platforms like Udemy, Coursera, Pluralsight, Educative, CodeCademy, edX, Udacity, and others. This is a decent collection of different types of JavaScript courses from different platforms. While you don't need to join all these courses, joining one or two will be enough.
Top 8 Online Courses to Learn Power BI in 2024 - Best of Lot
Top 6 Free Database and SQL Query Courses for Beginners to Learn Online in 2024 - Best of Lot
Top 7 Free Online Courses to learn JavaScript in 2024 - Best of Lot
Top 6 Online Courses to Learn Linux and UNIX in 2024 - Best of Lot [UPDATED]
7 Free Blockchain Developer Courses and Certifications to Learn in 2024 - Best of Lot
Top 10 Data Science and Machine Learning Courses, Certifications in 2024 - Best of Lot
Top 6 JavaScript Data Structure and Algorithm Courses for Beginners to Learn in 2024 - Best of Lot
Top 5 Courses to learn MERN Stack in 2024 - (MongoDB, Express.js, React.js, and Node.js) Best of Lot
Top 10 Udemy Courses for Java Developers in 2024 - Best of Lot
3 ways to check if checkbox is selected in jQuery - Example Tutorial
So, you have a checkbox and you want to check if its selected or not at runtime using jQuery. If that's what you want then continue reading. A checkbox is an HTML element with type="checkbox" and checked property is used to find out whether a checkbox is selected or not. There are several ways to find if your checkbox has this property or not in jQuery e.g. by using :checked, a pseudo selector or by using is() jQuery function or by using prop() function which is available from jQuery 1.6 onward. In this article, we will see examples of these approaches to check if a check box is checked or not.
Top 7 Spring Boot Online Courses for Beginners in 2024 - Best of Lot [UPDATED]
Top 10 Frequently asked SQL Query Interview Questions Answers
Top 15 Courses to Learn System Design and Software Architecture in 2024 - Best of Lot
Top 100 Data Structure and Algorithm Interview Questions for Java Programmers
Top 10 Books Java Developers Must Read
How to Reverse words in String Java? [Solution]
Top 5 Cloud Computing Books for Beginners to Read in 2024 - Best of Lot
How to remove duplicates from Collections or Stream in Java? Stream distinct() Example
Top 10 Algorithms books Every Programmer Should Read
10 Books and Courses to Prepare Technical Programming/Coding Job Interviews in 2024
5 Examples of map() and flatMap() in Java 8 Stream
Top 21 String Programming and Coding Interview Questions With Solutions
Top 21 jQuery interview Questions and Answers
Top 21 Maven Interview Questions Answers for Java Developers
Hello guys, for a Java developer, Maven in one of the essential tool and its used to build your Java application. Since most of the Java projects used Maven for building, it is expected from a Java developer that he knows Maven and knows it well. That's why Maven questions are quite common on Java developer interviews but I have seen many Java programmers coming to these interview unprepared and not able to answer most of the questions on tools like Maven, Gradle or even git. When I asked one candidate why don't you prepare for Maven before your Java interviews, he said, I wasn't able to find any list of Maven questions.
How to enable or disable form elements using jQuery? Examples
In last couple of tutorials you have learned how to get all selected checkbox and radio buttons, and in this tutorial, you will learn how to enable/disable form elements using jQuery. A form element e.g. a textfield, radio buttons and checkbox, all represented using input tag can be enabled or disabled by adding an attribute called "disabled". It's similar to "checked" attribute we have seen for checkbox and radio buttons. If this attribute is not present then element is enable, but if this attribute is present then you can use disabled=true to disable the form element and disabled=false to enable the form elements as shown in our example. Like previous example of checking/unchecking checkbox, you can use prop() jQuery function to enable/disable form element if you are running on jQuery 1.6 or higher version and attr() function if you are running on jQuery 1.5 or lower version.
How to shuffle a List in Java? Collections.shuffle() Example
How to Compare Two Dates in Java? Check If They Are Equal, Later or Earlier - Examples
What is transient variable in Java? Serialization Example
Difference between HashSet and HashMap in Java? Answered
Hello friends, if you have given Java developer interview then there is good chance that you may have come across questions like Difference between HashSet vs HashMap or HashSet vs TreeSet etc. In this article, we are going to discuss differnece between HashMap and HashSet, two of the popular Collection classes from JDK. The HashSet vs HashMap is a classical Java Collection interview question that focuses on What are differences between HashSet and HashMap in terms of features, usage, and performance. If you are in Java programming even for a year or so, you are likely to be familiar with What is HashSet in Java and What is HashMap in Java, these two are the most popular collection classes.
What is PATH and CLASSPATH in Java? Path vs ClassPath Example
The PATH and CLASSPATH are the two most important environment variables of the Java environment which are used to find the JDK binaries used to compile and run Java in windows and Linux and class files which are compiled Java bytecodes. From my personal experience I can say that PATH and CLASSPATH are the two most problematic things for beginners in Java programming language due to two reasons; first because in most Java courses nobody tells details of what is a PATH and CLASSPATH, What do PATH and CLASSPATH do, What is meaning of setting PATH and CLASSPATH, What happens if we do not set them, Difference between PATH vs CLASSPATH in Java or simply How Classpath works in Java, etc.
Why is main method public, static, and void in Java? Answer
The main() method in Java is a special method that is used by JVM to start the execution of any Java program. The main method is also referred to as the entry point of Java application which is true in the case of core Java applications because execution starts from the main() method, but in the case of container-managed environments like Servlet, EJB, or MIDlet this is not true as these Java programs have their own life-cycle methods like init(), service() or destroy() for Servlet's which is used by the container. The main method in Java is run by the main thread which is a non-daemon thread and the Java program runs until the main method finishes or any other user thread is running.
How to convert JSON String to Java Object using Gson? JSON Deserialization Example
Difference between var, val, and def in Scala? Examples
3 ways to convert String to JSON object in Java? Examples
Difference between Correlated and Non-Correlated Subquery in SQL? Examples
How to sort ArrayList in Java? Examples
What is final modifier in Java? fina class, method, and variable example
Best way to Convert Integer to String in Java with Example
How to create a ZIP File in Java? ZipEntry and ZipOutputStream Compression Example
How to add JAR files in Eclipse Project's Build path? Example
5 Tips to Fix Exception in thread "main" java.lang.NoClassDefFoundError in Java, Examples
The Exception in thread "main" java.lang.NoClassDefFoundError is a common error in Java that occurs if a ClassLoader cannot find a particular class in the classpath while trying to load it. The Exception in thread "main" suggests that this error has occurred in the main thread, the thread which is responsible for running the Java application. This error can occur to any thread, but if it happens in the main thread, then your program will crash because Java program runs only until main() thread is running or any other non-daemon thread is running. As per Javadoc, NoClassDefFoundError can be thrown during the linking or loading of the class file.
14 Enum Interview Questions and Answers for 1 to 2 Years Experienced Java Programmers
How to convert String to char in Java? Example Tutorial
How to get current TimeStamp value in Java? Example
5 Difference between String, StringBuffer, and StringBuilder in Java
Difference between include() and forward() methods of RequestDispatcher in Servlert
Base64 Encoding and Decoding Examples in Java 8 and Before
How Java achieves platform independence? Answer
10 Difference between Struts 1.x and Struts 2.x framework in Java
When You should Not use Microservice Architecture? (Answer)
Hello guys, recently while giving interview in one of the big US based Investment bank I was asked about, what are the scenarios when you shouldn't be using Microservices architecture? When I hear this question I was big surprised not because I didn't know the answer but because most of the people ask about using Microservice architecture and this was the first time I am hearing otherwise. To be honest, it's a good question because most of the candidate will prepare about benefirst about Microservice architecture and they may not know when it's not appropriate to use it. Since I have worked in low latency high frequency application, I knew that multiple process means more latency so clearly a Microservices is a big no if you are working on a high frequency low latency application. In those cases you want to do all your calculations inside a single thread or process without even swapping memory to avoid delay. Hence the first answer to this question was, you shouldn't be using Microservice in a low latency application.