Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
How to create an ArrayList from array in Java? Example
Difference between Proxy and Decorator Pattern in Java
Top 5 Java Certifications to aim in 2024 - Best of Lot
Unix command to find IP address from hostname - Linux example
How to find Files with Matching String in Linux? grep -l command Example
6 Essential Data Structures Java Programmer should Learn
13 Java Serialization Interview Questions with Answers for 3 to 5 Years Experienced
10 Regular Expressions Every Java Programmer Should Learn
Top 70 Java Interview Questions for Junior Developers [1 to 2 Years Experienced]
Top 5 Free JavaScript Books for Beginners - Download PDF or Read Online
Difference between Set, List and Map in Java - Interview question
Difference between Heap and Stack Memory in Java? [Explained]
Top 80 Core Java Interview Questions with Answers
10 Free Java Programing Books for beginners - download, pdf and HTML
How does Hello world program in Java works? Example and Explanation
How to Create, Start, and Stop a New Thread in Java? [Example Tutorial]
How to use CountDownLatch in Java? Example
How to sort a List or Stream by Multiple Fields in Java? Comparator comparing() + thenComparing Example
One of the common requirements in Java is to compare objects by multiple fields. For example, if you have a list of CreditCard objects and you want to compare them by their provider and credit limit I mean, first compare them by their providers like VISA, Master, or American Express and if they are from the same provider then compare them by their credit limit, also known as breaking ties. Before Java 8 this wasn't easy because you have to write nested codes to compare multiple fields of an object as there was no easy way to chain multiple Comparators in Java, but things have changed a lot from Java 8.
How to use CompletableFuture in Java? Example Tutorial
How to get the value of a checkbox using jQuery ? Example Tutorial
Suppose you have a web page with a checkbox like a registration page where you have a checkbox about reading terms and conditions. When the user clicks the submit button, your job is to validate whether that particular checkbox is checked or not? How do you do that? How do you get the value of the checkbox to see if it's checked or not? Well, you can use a pseudo-selector ":checked" to see if that checkbox is checked or not. This selector returns true if the user has clicked and kept the checkbox checked; false otherwise. You can get the checkbox either by class or id and then you can call the is(":checked") method, as shown in our example.