The Set interface does not allow duplicate elements, therefore, create a set object and try to add each element to it using the add() method in case of repetition of elements this method returns false − If you try to add all the elements of the array to a Set, it accepts only unique elements so, to find duplicate characters in a given string. Problem Statement Given a string, write a program in Java to delete duplicate characters from a given string − Input TUTORIALSPOINT Output Indices of the duplicate characters in the given string :: Index :: ... Read More
IP Address, also known as the Internet Protocol Address is a unique identifier that is assigned to a device in a network to identify the devices in the network and establish a connection between them. In this section, we will learn how to find the IP Address of a Windows and Linux Machine using Java Code. The IP Address can be represented in two formats. One format is IPv4 which is a 32 format containing decimals and dots. It has two parts, one part is network ID which identifies the network and the other is host ID which identifies ... Read More
Given an array and one of its element as an input, write a Java program to check whether that element exists in given array or not. You can find any element from an array using search algorithms. In this article, we will use linear search and binary search algorithms. Using Linear Search Algorithm In this approach, follow the steps below to verify whether a given element exists in an array − Iterate through the array using for loop. Compare each element with the required element. If found return the index. Example The following Java program shows how ... Read More
The strictfp keyword is a modifier that stands for strict floating point. As the name suggests, it ensures that floating-point operations give the same result on any platform. This keyword was introduced in Java version 1.2. In Java, the floating point precision may vary from one platform to another. The strictfp keyword solves this issue and ensures consistency across all platforms. With the release of Java 17 version, the strictfp keyword is no longer needed. Regardless of whether you use this keyword, the JVM now provides consistent results for floating-point calculations across different platforms. When to use Java strictfp keyword? ... Read More
To write an int array in a file in Java, we use write() method of the FileWriter class. The FileWriter class in Java is part of the java.io package and is used to write character data to a file. It provides constructors to create a file writer object and methods like write() to write data to the file. The close() method closes the file and releases resources. We will use the write() method to take an integer value, convert it to a string representation, and then write that string to the file. Thus, it writes the numeric values from ... Read More
Distributed and parallel computing consists of multiple processors or autonomous computers where either memory is shared or a computer is used as a single system. In this article, we will discuss the difference between distributed and parallel computing. What is Parallel Computing? Parallel computing is a system in which multiple processors are used to perform different types of tasks. This is a system in which memory can be shared or distributed between the processors. Parallel computing is a system which can be used to save money and time. Parallel computing is also known as parallel processing in which each processor ... Read More
There are situations in a database in which if one transaction has to access data, other transactions should not be allowed to access the same data. In such a case, the lock is important to prevent other transactions from using the data that is being used by a transaction. Locks are of two types which include shared locks and exclusive locks. In this article, we will see the difference between shared lock and exclusive lock. What is a Shared Lock? Shared lock is a lock that does not permit to work on data by a transaction if it is being ... Read More
The most trending technical topics nowadays are artificial intelligence, machine learning, and deep learning. All these technologies are being implemented nowadays in different machines, software applications, etc. In this article, we will discuss the difference between artificial intelligence, machine learning, and deep learning. What is Artificial Intelligence? Artificial intelligence is a technology in which a list of rules is used by machines and they act in the same way as humans. AI can be defined as the training of machines by using different algorithms so that they can act in the same way as humans. AI has the parts which ... Read More
Web hosting and web publishing are the most important aspects if you want to make your website online. Web hosting is a technology which can be used for storing your website on a web server. Web publishing is a technology which can be used for creating content and adding it to your website. In this article, we will discuss the difference between Web Hosting and Web Publishing. What is Web Hosting? Web hosting is used to upload a website on the internet with the help of WWW. The main job of web hosting is to provide storage space for the ... Read More
Computers are of different types like micro, mini, mainframe, and super. All types of computers have different functions. Some of them are used as personal computers while some are used as servers, web servers, etc. In this article, we will discuss the difference between microcomputers and minicomputers. What is Microcomputer? Microcomputers can be used as personal computers which consist of a single-chip CPU, memory, I/O buses, etc. Microcomputers can be used as desktops, laptops, smartphones, tablets, etc. Only one user can use these computers at a time. Uses of Microcomputers Microcomputers have different uses and we will; discuss about them ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP