Aishwarya Naglot has Published 180 Articles

Nearest 1 in a binary matrix in C++

Aishwarya Naglot

Aishwarya Naglot

Updated on 05-Nov-2024 15:15:19

211 Views

In this article, we will show you how to find the minimum distance from each cell in a binary matrix to the nearest cell that contains the digit 1. We will see brute force as well as optimized approaches. Problem Statement Given a binary matrix, our task is to calculate ... Read More

Longest double string of a Palindrome

Aishwarya Naglot

Aishwarya Naglot

Updated on 05-Nov-2024 15:01:01

111 Views

A contiguous sequence of characters, consisting of uppercase, lowercase, repetitive, or unique alphanumeric characters, forms a C++ string. Each string has a unique length, which may be either odd or even in nature. Longest Double String of a Palindrome A Palindromic string is a sequence of characters that reads the ... Read More

C++ Program to Print “Even” or “Odd” without using conditional statement

Aishwarya Naglot

Aishwarya Naglot

Updated on 05-Nov-2024 14:55:30

3K+ Views

We can easily check the Odd or Even by using conditional statements. We can divide the number by 2, then check whether the remainder is 0 or not. If 0, then it is even. We can also perform the AND operation ... Read More

Difference Between CGI and Servlet

Aishwarya Naglot

Aishwarya Naglot

Updated on 11-Oct-2024 15:23:41

3K+ Views

In this article, we will understand the difference between CGI and servlet. Servlet is a Java class that helps servers to extend their abilities by hosting applications accessed using a request-response model. CGI behaves like middleware between www servers and external databases or information resources, helping pass data between the ... Read More

Difference between mutable and immutable object

Aishwarya Naglot

Aishwarya Naglot

Updated on 10-Oct-2024 14:18:27

4K+ Views

In Java, state of the immutable object can’t be modified after it is created but definitely reference other objects. They are very useful in multi-threading environment because multiple threads can’t change the state of the object so immutable objects are thread-safe. Immutable objects are very helpful to avoid temporal coupling ... Read More

Difference between Applets and Servlets in Java.

Aishwarya Naglot

Aishwarya Naglot

Updated on 10-Oct-2024 13:40:48

6K+ Views

In Java, both Applets and Servlets are the programs or applications that run in a Java environment. Applets are designed to provide interactive features that can be embedded into web pages and allow users to engage with content directly through their web browsers. On the other hand, Servlets operate on ... Read More

Difference between concat() and + operator in Java

Aishwarya Naglot

Aishwarya Naglot

Updated on 10-Oct-2024 12:46:11

2K+ Views

Java provides two ways to append strings and make them one. These two methods are namely the concat() method and + operator to join strings together, but there are some important differences between how they work. The concat() method is a bit more specific and limited, while the + operator is ... Read More

Java Program to insert an element at the Bottom of a Stack

Aishwarya Naglot

Aishwarya Naglot

Updated on 04-Oct-2024 12:24:27

437 Views

A stack is a data structure that follows the LIFO (Last In, First Out) principle. In other words, The last element we add to a stack is the first one to be removed. When we add (or push) elements to a stack, they are placed on top; i.e. above all ... Read More

When to use @ConstructorProperties annotation with Jackson in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 09-Jul-2020 07:19:56

2K+ Views

Jackson is a library that is used for converting Java objects to JSON and vice versa. It provides various annotations to customize the serialization and deserialization process. One such annotation is @ConstructorProperties, which is used to specify the properties of a constructor for deserialization. The @ConstructorProperties annotation is from java.beans ... Read More

Are Multiple Constructors possible in Java?

Aishwarya Naglot

Aishwarya Naglot

Updated on 30-Jun-2020 08:45:40

12K+ Views

Constructors in Java are special methods that are used to initialize objects. In Java, it is possible to have multiple constructors in a class; this is known as constructor overloading. So, the answer to the question "Are multiple constructors possible in Java?" is yes, Java allows multiple constructors in a ... Read More

Advertisements