Found 9150 Articles for Object Oriented Programming

Testing Spring Security Auth with JUnit

Sabid Ansari
Updated on 19-Jun-2023 10:57:25

551 Views

Introduction Spring Security is a highly customizable authentication and access-control framework for Java applications, particularly for Spring-based applications. Testing these security measures is crucial to ensure a secure application. In this article, we'll explore how to effectively test Spring Security with JUnit, a leading unit testing framework in Java. Understanding Spring Security and JUnit Spring Security is a powerful framework that provides authentication, authorization, and other security features for enterprise-grade applications. It's comprehensive yet flexible, making it suitable for a variety of security requirements. JUnit is a simple, open-source framework used to write repeatable tests in Java. It provides annotations ... Read More

Test Driven Development using JUnit5 and Mockito

Sabid Ansari
Updated on 19-Jun-2023 10:52:46

990 Views

Test-Driven Development (TDD) is a software development approach where tests are written before the actual code. TDD has gained substantial traction due to its emphasis on code quality and maintainability. This article explores how TDD can be effectively implemented using JUnit5 and Mockito, two powerful frameworks in the Java ecosystem. What is Test-Driven Development? Test-Driven Development is an iterative development process where developers first write a test case for a new function or feature, then write the minimum amount of code to pass that test, and finally refactor the code for optimization. This approach enhances the design, reduces bugs, and ... Read More

Tesseract OCR with Java with Examples

Sabid Ansari
Updated on 16-Jun-2023 14:09:52

6K+ Views

Introduction Optical Character Recognition (OCR) plays an instrumental role in digitizing printed text, allowing it to be edited, searched, and stored more compactly. One of the most powerful OCR tools available is Tesseract OCR. This article will explore how to use Tesseract OCR with Java, providing detailed examples to enhance your understanding. What is Tesseract OCR? Tesseract OCR is an open-source OCR engine sponsored by Google that can recognize more than 100 languages out of the box. It's widely regarded for its accuracy and adaptability, making it a popular choice for developers across various applications. Integrating Tesseract OCR with Java ... Read More

What is advanced Java?

Priya Mishra
Updated on 06-Aug-2024 18:35:28

10K+ Views

Introduction to Advanced Java Core Java (J2SE) and Advanced Java are the two components that make up the Java programming language (JEE). The foundations of the Java programming language, including its data types, functions, operators, loops, threads, and exception handling, are discussed in the "core Java" section of this book. It is used in the process of developing apps for widespread usage. Whereas Intermediate Java focuses on more advanced topics, such as database connection, networking, Servlet, web services, and so on, Advanced Java addresses more fundamental ideas. In this article, we will talk about what advanced Java is, and the concepts ... Read More

Program to print Hut Star pattern

Shriansh Kumar
Updated on 16-May-2023 11:21:11

796 Views

Solving interesting pattern problems enhances the understanding of loops. They are essential because they help in building a strong foundation of a particular programming language. There are various kinds of patterns including number-based, star-based and alphabetical patterns as well. This article will guide you to solve a hut star pattern using nested for loop in Java. Java Program to print Hut Star Pattern Since we are going to solve the problem using nested for loop therefore, it is necessary to discuss its syntax. Syntax for ( initial expression; conditional expression; increment/decrement expression ){ for ( ... Read More

Public vs Protected vs Package vs Private Access Modifiers in Java

Shriansh Kumar
Updated on 16-May-2023 11:19:58

737 Views

Java has various levels of protection that allow precise control over the accessibility of member variables and methods within classes, subclasses, and packages. The access control mechanism works with the help of access modifiers such as public, protected, private and package. They define scope of a variable, class and method. We are going to understand the various access modifiers in Java. Access Modifiers in Java Public Access Modifier Java does not restrict the accessibility of public members. Anything declared public can be accessible everywhere means we can access them within the class as well as outside the class and ... Read More

Protected vs Package Access Modifiers in Java

Shriansh Kumar
Updated on 16-May-2023 11:04:21

746 Views

The protected and package access modifiers determine how a member of a class or method can be accessed. The modifiers are attached to the members at the time of declaration. We know that these access modifiers play a major role in Java oops concepts like encapsulation, polymorphism and inheritance. It helps in preventing misuse of functionalities provided by a member. We will try to understand protected and package access modifiers in Java through example programs. Access Modifiers in Java Protected Access Modifier It is mostly used in the case of inheritance to control the access of parent class members ... Read More

Protected vs Final Access Modifier in Java

Shriansh Kumar
Updated on 16-May-2023 11:01:04

1K+ Views

The protected and final access modifiers determine how a member of a class or method can be accessed. The modifiers are attached to the members at the time of declaration. We know that these access modifiers play a major role in Java oops concepts like encapsulation and inheritance. It helps in preventing misuse of functionalities provided by a member. We will try to understand protected and final access modifiers in Java through example programs. Access Modifiers in Java Protected Access Modifier It is mostly used in the case of inheritance to control the access of parent class members and ... Read More

Program to validate a user using JSP

Shriansh Kumar
Updated on 16-May-2023 10:58:16

4K+ Views

JSP stands for Java Server Pages and is used for the purpose of developing web based applications. A single JSP page consists of HTML tags for static content and JSP tags to construct dynamic content. The JSP tags start with ‘’. We save our JSP file with the extension ‘.jsp’. Validating a user means simply checking whether the user has entered correct login details or not. The validation process in JSP is quite simple and straightforward. This article will guide you to create a program to validate a user using JSP. Steps to create a Program to Validate a ... Read More

Reetrant Lock in Java

Shriansh Kumar
Updated on 16-May-2023 10:53:41

572 Views

ReetrantLock is a class that implements Lock Interface. It provides the synchronization feature with great flexibility which is why it is the most used lock class in Java. It is necessary for the reliable and fair working of thread. Here, threads are small sub-processes of a big operation. In this article, we are going to learn ReetrantLock and how they manage threads so that they can work efficiently. Working of ReetrantLock When multiple threads try to access a shared resource then, ReetrantLock restricts access to a single thread at a time through ‘lock()’ and ‘unlock()’ methods. Suppose there are ... Read More

Advertisements