-
What is Binary Tree : Complete Guide with Algorithms
A Binary Tree is a tree data structure where each node has no more than two child nodes, known as the left child and right child. If every node in a tree can have at most two children, the tree is called a binary tree. Components of a Binary Tree How to insert new node in Tree Step-by-Step Logic of Insertion 2.RkdigitalTree.java How to find a node in tree Finding a node in a Binary Tree is the process of searching for a particular element in the tree structure. The search starts from the root node and moves through the left subtree and right subtree until the required value is…
-
What is a Linked List? Types, Operations, and Real-World Examples
Why Do We Need Linked Lists? In real programming, data size is often unknown or frequently changing. Arrays create problems in such situations. Arrays Issues are . To overcome the above issues LinkedList comes into the pictures . Linked Lists are fundamental data structure in computer science and they offer several advantages . Types of LinkedList 1. Singly Linked List A Singly Linked List is a type of linked list data structure in which each node contains data and a reference (pointer) to the next node only. It is called singly because every node connects in one direction — from the current node to the next node. Structure of Singly…
-
What is design pattern
Design Patterns are proven, reusable solutions to common problems that occur while designing software systems . A Design Pattern is: Why Design Patterns Are Important Categories (Types) of Design Patterns Design patterns are mainly divided into three major categories 1. Creational Design Patterns Instead of creating objects directly, these patterns control how objects are created. 2. Structural Design Patterns 3.Behavioral Design Patterns Behavioral design pattern Focus on communication between objects. They define how objects interact and share responsibilities. Behavioral patterns are Example: Create objects from one central place. Client does NOT know how objects are created. 1. Create Interface 2. Create Classes 3. Factory Class 4.Client Code
-
Anonymous Classes in Java and When to Use Them?
An anonymous class in Java is a class without a name that is both defined and instantiated in a single expression. Developers commonly use anonymous classes to create instances of classes or implement interfaces without writing a separate named class. This helps in writing cleaner and more concise code, especially for short-term or one-time use cases in Java programming. Characteristics of Anonymous classes Anonymous class is Example: Example without Anonymous class 1. Greeting.java (Interface) 2. GreetingImpl.java (Interface Implementation) 3. DemoTest.java Example: Example with Anonymous class 2. DemoTest.java Explanation of Above code : Anonymous Inner classes An anonymous inner class in Java is a way to define and instantiate a class…
-
Java 8 Features
Java 8 was introduced to modernize Java by adding functional programming features, improving performance, and making the language more concise, readable, and expressive. It aimed to reduce boilerplate code, improve parallel processing, and enable more declarative coding styles—especially important for handling large data collections and multi-core processors. Lambda Expressions 2. Functional Interfaces 3. Default Method in Interface 4.Static Method in Interface Interface MyInterface { default void show() { System.out.println("Default method"); }} 5. Stream API list.stream().filter(s -> s.startsWith("A")).collect(Collectors.toList()); Intermediate (Non-Terminal) operations Example : Terminal operations 6. Method References 7. Optional Class 8. New Date and Time API (java.time package) Old API problems: New API advantages: 9. Collectors Class Commonly Used Collectors…
-
What is application
An application refers to a program or software designed to perform specific tasks for users. Applications can range from simple tools like calculators to complex systems such as enterprise resource management platforms. Types of Applications To develop distributed application we use a language called java and java comes under internet software. Architecture required for development of distributed application , programmer must use a well known Architecture known as client server architecture . 2-Tier Architecture Two tier Architecture it contains client and server side programing . 3-Tier Architecture Three tier architecture it contains client , server program and database software n-Tier Architecture n tire architecture it contains client program , fire wall program(security…