Articles on Trending Technologies

Technical articles with clear explanations and examples

Java program to create a HashMap and add key-value pairs

karthikeya Boyini
karthikeya Boyini
Updated on 05-Sep-2024 2K+ Views

In this article, we will write a Java program to create a HashMap and add key-value pairs. We will be using the HashMap class we can import HashMap class form java.util package. A HashMap is a collection that stores data in the form of key-value pairs, allowing quick retrieval of values based on their keys. We'll also see how to display the elements stored in the HashMap using an iterator in our given program. Problem Statement Write a program in Java to create a HashMap and add key-value pairs − Output Belt: 600Wallet: 700Bag: 1100 Steps to create a HashMap and add ...

Read More

Java program to get random letters

karthikeya Boyini
karthikeya Boyini
Updated on 05-Sep-2024 2K+ Views

In this article, we will learn to write a program in Java to get the random letters in both lowercase and uppercase. We will be using Random class from java.util package.The program will first create random lowercase letters by selecting them from the alphabet, and then it will generate random uppercase letters in a similar way.  Problem Statement Write a program in Java to get the random letters both uppercase and lower case. Below is the demostration − Output Lowercase random letters...dlhjsUppercase random letters...BKIZN Step to get random letters Following are the steps to get the random letter using Java ...

Read More

Java program to check occurrence of each character in String

Chandu yadav
Chandu yadav
Updated on 05-Sep-2024 26K+ Views

To find the occurrence of each character in a string we can use the Map utility of Java. In Map a key cannot be duplicated so make each character of the string a key of Map and provide the initial value corresponding to each key as 1 if this character is not inserted in Map before. Now when a character repeats during insertion as a key in Map increases its value by one. Continue this for each character until all characters of the string get inserted. Problem Statement Write a program in Java to check the occurrence of each character in ...

Read More

Java program to find sum of natural numbers using while loop

Shiva Keerthi
Shiva Keerthi
Updated on 05-Sep-2024 762 Views

The sum of natural numbers can be calculated using different Iterative Statements in Programming Languages. Iterative Statements are statements that execute a particular set of code lines until the condition in the loop statement fails. In this article, we will discuss how to calculate the sum of natural numbers using a while-loop which is an iterative statement in Java. Sum of Natural Numbers The sum of natural numbers generally indicates the total sum of elements from 1 to n. Mathematically it can be represented as follows Sum of n Natural Numbers = 1+2+3+.........+(n-2) + (n-1) + n ...

Read More

Java program to find sum of even factors of a number

AmitDiwan
AmitDiwan
Updated on 05-Sep-2024 1K+ Views

In this article we’ll find the sum of even factors of a given number using Java. We’ll start by checking if the number is even, then identify all of its factors, sum up those that are even, and finally display the result. Problem Statement Write a Java program to find the sum of even factors of a number. Below is the demostration of the same − Input num=16 Ouput The sum of even factors of the number is 30 Steps to find sum of even factors of a number Following are the steps to find sum of even factors of a number ...

Read More

Difference Between A* and AO* Algorithm

Abhijat Sarari
Abhijat Sarari
Updated on 04-Sep-2024 8K+ Views

In the fields of artificial intelligence and computer science search algorithms are essential for resolving challenging issues. Envision yourself searching for the way out of an enormous maze. You might aimlessly attempt every route in the hopes of failing. But wouldn't it be preferable to have a knowledgeable guide who is familiar with the maze ? In the digital realm, search algorithms are precisely like that! They assist computers much like you in a maze of options in determining the optimal course. The algorithms A* and AO* are two examples. In this blog article we'll go over their definitions, mechanisms, ...

Read More

3D Printing - What It Is, How It Works, Examples

Shirjeel Yunus
Shirjeel Yunus
Updated on 04-Sep-2024 2K+ Views

Table of Content What is 3D Printing? History of 3D Printing Types of 3D Printing Materials used in 3D Printing 3D Printing Uses and Examples How to choose a 3D Printer Design Guidelines for 3D Printing 3D Printing Software 3D Printing Vs. Additive Manufacturing 3D Printing Vs. Rapid Prototyping 3D Printing Vs 4D Printing Future of 3D Printing Advantages of 3D Printing Disadvantages of 3D Printing Conclusion FAQs on 3D Printing What is 3D Printing? 3D printing is a process in which three-dimensional objects are created from a file. Additive processes are used to create the 3D objects. ...

Read More

How to check the version of ReactJS?

Mohammed Shahnawaz Alam
Mohammed Shahnawaz Alam
Updated on 04-Sep-2024 3K+ Views

ReactJS is a frontend library of JavaScript to build efficient Single Page Application(SPA). Each version of React comes with some improvements and added features. So, it is very important to know which version we are using. Approaches to Check React Version We can check the version of ReactJS by using the below-mentioned Approaches. Using Command Line Using ‘React.version' Property Searching in dependencies in package.json React Version Using Command Line We can use the below command to check the version of ReactJS. The below command ...

Read More

Difference Between Internet of Things and Artificial Intelligence

Lara Croft
Lara Croft
Updated on 03-Sep-2024 213 Views

IoT and Artificial Intelligence are the similar consents but internally these are different than each other lets see their differences. What is Internet of Things? Internet of things is also abbreviated as IoT, Its a concept where everyday objects like appliances, vehicles, and even clothing basically internally connected devices which are connected to the internet and can communicate with each other, collect data, and share information What is Artificial Intelligence? Artificial Intelligence(AI) is the human intelligence which allow machines to think like a human and for problem solving. AI systems are especially designed to solve the problem or perform a ...

Read More

Java program to multiply long integers and check for overflow

Samual Sam
Samual Sam
Updated on 02-Sep-2024 2K+ Views

To check for Long overflow, we need to check the Long.MAX_VALUE with the multiplied long result, Here, Long.MAX_VALUE is the maximum value of the Long type in Java. Let us see an example wherein long values are multiplied and if the result is more than the Long.MAX_VALUE, then an exception is thrown. Steps to multiply long integers and check for overflow Following are the steps to multiply long integers and check for overflow in Java − Initialize long values by defining two long integers, val1 and val2. Multiply val1 and val2 to ...

Read More
Showing 31951–31960 of 61,297 articles
Advertisements