This repository contains basic Java programs. Mainly used for training purpose.
ASSIGNMENTS ON STRING AND ARRAYS.
A. The string has a s.toCharArray() method that can be used for converting string to a character array. Example snippet below.
String s = "GeeksforGeeks"; char[] gfg = s.toCharArray(); for (int i = 0; i < gfg.length; i++) { System.out.println(gfg[i]); }
B. String has a split() method that allows you to split a string in to an array of strings. https://www.geeksforgeeks.org/split-string-java-examples/
- Reverse the String.
- Check if a string is palindrome?
- Count the number of words in a sentence?
- Remove extra white spaces in a sentence.
- Remove duplicate elements in an integer array
- Find largest and second largest number in an integer array
- Sort the elements in an array in ascending order.
- Find the missing number in an Array between 1 to 100. Given only one number is missing.