In this article, we will learn how to find the number in an array that appears an odd number of times using Java. By looping through the array and counting occurrences of each number, the program will detect and return the one with an odd frequency. Problem Statement Given an array identify the integer that occurs an odd number of times. Below is the demostration of the same − Input 34, 56, 99, 34, 55, 99, 90, 11, 12, 11, 11, 34 Output The number that occurs odd number of times in the array is 34 Steps to find the number occurring ... Read More
In this article, we will learn how to remove a specific key from a HashMap in Java. By doing this, we can dynamically update the contents of the map, which is helpful in many data manipulation scenarios. We will demonstrate two different approaches: one that uses the straightforward remove() method to delete a specific key, and another that leverages an iterator to find and remove the key based on a condition while iterating. Each approach allows us to efficiently manage data in HashMap based on different requirements. Problem Statement Given a HashMap with key-value pairs, write Java programs to ... Read More
In this article, we will learn the procedures for sorting a HashMap in Java by its keys and values, as well as examine the performance implications associated with each technique. HashMap, a frequently employed data structure, enables programmers to store key-value pairs. This data structure is an exceedingly efficient method for storing data and allows for swift value retrieval based on keys. However, on occasion, it may become necessary to arrange the HashMap by its keys or values. Different Approaches of Sorting the HashMap Following are the different approaches to sorting a HashMap by Keys and Values − ... Read More
In this article, we will learn how to format date and time in Java using the Formatter and Calendar classes. The Formatter class allows for flexible string formatting, and the Calendar class is useful for retrieving and manipulating date and time values. We will use these classes to display the current hour, minute, and AM/PM marker. Problem StatementGiven a Calendar instance, write a Java program to display the current hour, minute, and AM/PM marker using the Formatter class.Input The program fetches the current date and time using the Calendar class.Output Current date and time: Mon Nov 26 07:41:35 UTC 2018 ... Read More
In this article, we will learn how to set major tick marks in a JSlider component in Java. A JSlider is a Swing component that allows users to select a numeric value from a range. Tick marks help improve user experience by marking specific intervals along the slider. Major tick marks represent larger intervals, and we can control their spacing using the setMajorTickSpacing() method. Problem StatementGiven a slider with a range of values, write a Java program to set major tick marks every 25 units in a JSlider and display the slider in a GUI window.Input A slider with a range ... Read More
In this article, we will understand how to remove all whitespaces from a string in Java. The String class in Java represents a sequence of characters enclosed in double-quotes. Removing whitespaces from a string is a common operation, especially when processing user input or cleaning data. The replaceAll() method is used with a regular expression to match whitespace characters and replace them with an empty string. Problem StatementGiven a string with whitespaces, write a Java program to remove all whitespaces from the string.Input Initial String = "Java programming is fun to learn."Output String after removing white spaces = ... Read More
The following are some often requested SQL Interview Questions for both new and seasoned testers.1) What exactly is database testing?Backend testing is another term for database testing.Database testing is divided into four types.Data Integrity TestingValidity testing of dataPerformance of data basesFunction, process, and trigger testing2) In database testing, what do we need to verify on a regular basis?Typically, the following items are checked in DB Testing −Check for ConstraintsValidation of a Field DimensionPreserved techniqueMatching the size of application fields to the size of database fieldsIndexes for issues based on performance3) What is a data-driven test?A data-driven test is used in ... Read More
Introduction MySQL is one of the most widely used open-source relational database management systems (RDBMS) in world. It is used by some of the largest companies in the world, including Google, Facebook, and Twitter. If you are preparing for an interview for a MySQL developer position, you need to be well-prepared with advance MySQL database interview questions and answers. In this article, we will cover some of the most common and advanced MySQL database interview questions and provide you with the best possible answers. What is MySQL? MySQL is an open-source relational database management system. It is widely used by ... Read More
As a database administrator, you need to be well-versed in MySQL, one of the most popular open-source database management systems. Whether you are a beginner or an experienced professional, there are some basic MySQL interview questions that you should be prepared to answer. In this article, we'll cover some of the most common questions and provide examples to help you prepare for your next interview. What is MySQL? MySQL is an open-source relational database management system (RDBMS) that uses SQL (Structured Query Language) to manage and manipulate data. It was first released in 1995 and is currently owned by Oracle ... Read More
A monorepo, short for "monolithic repository, " is a single repository containing multiple projects, it's commonly used by large-scale projects or organizations that want to simplify dependency management, build processes and overall project structure. Read this tutorial to learn how to move multiple projects into a single Git repository while maintaining their unique commit history. We'll also outline the tools and processes needed to seamlessly merge multiple projects into a single repository. Step-by-Step Guide to Importing Projects Here is a step-by-step guide on how to import multiple projects into a single repository - Step 1: Cloning and Preparing the ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP