Java Program to separate the Individual Characters from a String8 Jan 2025 | 1 min read In this program, we need to separate each character from the string. CHARACTERS C H A R A C T E R S In computer science, collection of characters including spaces is called as string. To separate an individual character from the string, individual characters are accessed through its index. Algorithm
Program:Output: Individual characters from given string: c h a r a c t e r s Next TopicJava Programs |
An array containing various numbers is given. The task is to create different groups, each containing only two elements, such that the difference between the group containing the largest sum and the group containing the lowest sum should be minimum. Note that any element can only...
5 min read
In this program, we need to check whether all the leaves of the given binary tree are at same level or not. A Node is said to be leaf if it doesn't have any child node. In the below diagram, nodes 4, 5 and 6 are...
5 min read
In this section, we have created a number of Java program to check if a given number is perfect square or not. The perfect square or square number is a positive integer that is square of an integer. In other words, when we multiply two same numbers...
6 min read
Java program to print the following pattern on the console 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 Algorithm: STEP 1: START STEP 2: DEFINE i, j. STEP 3: SET n=5. STEP 4: SET i=n. REPEAT STEP 5 to STEP 7 UNTIL i>0. STEP 5: SET j=1. REPEAT STEP...
2 min read
In this program, we need to search a node in the given singly linked list. Identity Matrix To solve this problem, we will traverse through the list using a node current. Current points to head and start comparing searched node data with current node data. If they...
5 min read
Buzz number is another special number in Java that ends with digit 7 or divisible by 7. Unlike Prime and Armstrong numbers, the Buzz number is not so popular and asked by the interviewers. In simple words, a number is said to be Buzz if it ends...
3 min read
Program to print the elements of an array This is a simple program to create an array and then to print it's all elements. Now, just know about arrays. Arrays are the special variables that store multiple values under the same name in the contiguous memory allocation. Elements...
1 min read
Java Convert int to char We can convert int to char in java using typecasting. To convert higher data type into lower, we need to perform typecasting. Here, the ASCII character of integer value will be stored in the char variable. To get the actual value in char...
2 min read
? In Java, the sort() method is a static and overloaded method defined in the java.util.Arrays class. It is used to sort arrays values of different types. The order may be in ascending or descending order. The numerical and lexicographical (alphabetical) order is widely used. The sort()...
11 min read
In this program, we need to remove the duplicate nodes from the given singly linked list. Original List: List after removing duplicate nodes: In the above list, node 2 is repeated thrice, and node 1 is repeated twice. Node current will point to head, and index will point...
7 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India