Default Method in Interface Java 8 Core Java java by devs5003 - August 27, 2024August 29, 20240 As we are aware that till JDK 7 we couldn't include implemented method inside an interface. In other words, there was no provision to have a method body inside a method of an Interface. But for those who are reading Default Methods for the first time it will be very surprising. The surprise is that we can now include an implemented method inside an Interface. Therefore, we can also have an implemented method inside an interface. Here, we are talking about default method in interface. The most use of default method in interface is to provide additional functionality to a given type without breaking down the existing implemented classes. In this article, we are going to take a deeper look on
Static Methods In Interface Java 8 Core Java java by devs5003 - August 26, 2024August 29, 20241 Before learning the Static Methods in Interface let's go back to JDK 7 and older versions, and memorize the scope of a static method. We will come to a conclusion that Static Methods could be defined in a class, abstract class, final class but not in an interface. However, from JDK 8 onward, we can define Static Methods in Interface as well. Now you might have one question 'What is the need of defining Static methods in Interface?'. Wait for a couple of minutes, you will get to know each & every concept behind it. In this article we will have a closer look on the 'Static Methods in Interface'. Furthermore, we will also talk about main() method as the main()
How to Extract Text from Image Using Java? Core Java java by devs5003 - August 18, 2024August 21, 20241 Many a times we come across a requirement when we need to extract text from image. This process is also known as Optical Character Recognition (OCR). OCR is extensively useful in various use cases, such as converting physical documents into digital formats to make them searchable and editable, automating data entry processes to minimize errors, extracting information from checks in banking institutions, digitizing patient records in the healthcare industry, converting case files into digital formats in the legal department, digitizing textbooks, extracting information from invoices, receipts, and many more. This article will focus on How to Extract Text from Image Using Java?. Although there are many online image-to-text converter tools are introduced that can extract text from image automatically, but knowing
How To Sort the List in Java 8 Core Java Interview java Java 8 by devs5003 - July 14, 2024July 16, 20240 During project development, every developer come across a situation where implementation of sorting becomes mandatory. There are many flavors of sorting. It depends on the scenario which one to implement where. In this article, we have mainly focused on sorting using Java 8. Moreover, we have also provided an example which was being used before the introduction of Java 8. Hence our article is on 'How To Sort the List in Java 8'. Sorting a list using Java 8 can be more performant due to the introduction of the Java Stream API and lambda expressions, which enable more efficient sorting operations. There are multiple ways to sort a list of items already available before Java 8. Further, Java 8 has introduced different
Collection MCQ in Java with Answers Explained Collections collections in java Core Java java MCQ by devs5003 - July 7, 2024July 11, 20240 Definitely, Collections are the most important for a Java developer. You can't imagine even a minor project in Java without the use of Collections. Moreover, in order to work in an industry level project, you must have a good grasp on Collections in Java. Apart from going through theoretical concepts multiple times, it is highly advisable that developers need much practice & revision of concepts. One of the ways to achieve this is by attempting FAQs/MCQs on collections. In this article, we will be doing theoretical practice on ‘Java Collections’ in the form of MCQs that are frequently asked in the interviews as well. Definitely, you must find this article 'Collection MCQ in Java with Answers Explained' beneficial whether it is
Annotations In Java java Core Java by devs5003 - May 31, 2024June 2, 20245 Before the introduction of Annotations, we were extensively using XML for metadata. Using XML for metadata as configurations separates the configuration from the code. At the later stage, when enterprise applications grown up, maintenance of XML was getting inconvenienced. Also, XML loosely couples from the code, in some cases almost separates. Then architects & developers started looking for solutions which can be tightly coupled with the code instead of XML. Then the solution was an introduction to Annotations. Don't get confused with the fact that we should always prefer loose coupling as it differs in case of Annotations. You will feel the benefits almost always when you completely understand the topic 'Annotations In Java'. Just using an annotation instead of creating
Continuation-Passing Style-CPS in Java Core Java java Programming by devs5003 - May 15, 2024May 17, 20240 Continuation-Passing Style (CPS) is a programming model used to manage control flow in software applications. It provides a way to handle asynchronous or callback-based programming by explicitly passing control from one function to another. Although this concept was originally generalized in functional programming languages like Scheme, Haskell, and Scala, but CPS can also be implemented in object-oriented languages like Java. In this article, we'll analyze the concepts behind Continuation-Passing Style-CPS in Java and explore its implementation with code examples. What is Continuation-Passing Style? In traditional programming model, control flow is managed through the call stack. When a function is called, the current execution context is pushed onto the stack, and when the function returns, the context is popped off the stack, allowing
Record vs. Lombok Core Java java Lombok Record In Java by devs5003 - May 1, 2024May 18, 20240 Every Java developer attempts to reduce the boilerplate code whenever it is possible. Undoubtedly, the new JDK versions and even modern frameworks like Spring, Spring Boot have already contributed much to make it possible. In this matter, Records in Java 16 and Lombok library are also known to reduce boilerplate code. Java 16 Records are a native language feature introduced in Java 16. Lombok is a third-party library that provides annotations to eliminate repetitive common tasks. In this detailed comparison 'Record vs. Lombok', we will explore the definition, syntax, usage, advantages, disadvantages, and practical examples of Java 16 Records and Lombok, and compare them based on various parameters. Let's start with what is Record and what is Lombok. Record vs. Lombok: Purpose, Usage,
Java Testing Frameworks Core Java java Java Testing by devs5003 - April 22, 2024April 25, 20240 A Comprehensive Guide to Java Testing Frameworks Testing in Java applications is an essential part of the software development process It plays a vital role in reliability, code quality, and the complete success of the application. There are various testing frameworks that make testing easier for developers & testers. These frameworks provide systematic conditions that allow developers to write, organize, and execute tests in a structured manner. Their primary purpose is to validate the correctness, functionality, and performance of the code under diverse conditions. A Comprehensive Guide to Java Testing Frameworks These frameworks facilitate different types of testing methodologies. For example, Unit testing focuses on verifying the smallest parts of an application, such as individual methods or classes. On the other hand, Integration testing
Java 17 Features Core Java java Java 17 jdk 17 by devs5003 - April 13, 2024April 15, 20240 Undoubtedly, the demand of Java 17 features became crucial after the release of Spring Boot 3.0. Needless to say, the use of Java 17 has become mandatory since Spring Boot 3.0. It also means that every Java developer should be aware of the new changes introduced in Java 17. Java 17 comes with several new features and enhancements that aim to improve developer productivity and program efficiency. In this article, we will explore some of the most significant Java 17 features, with code examples to help you understand how to use them effectively. Java 17 is an LTS (Long-term support) release of the Java programming language. As it is an LTS version, it will receive prolonged support and security updates for