This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//creating iterator n for collection numbers | |
for(Iterator n = numbers.iterator() ;n.hasNext(); ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//charAt method will pick the specific character of the string of position number of j | |
for (int j = 0; j < halfString.length(); j += 2) { | |
char finalOutPutChar = halfString.charAt(j); | |
finalOutPut = finalOutPut + finalOutPutChar; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//You can use any of the following options based on the requirements. | |
//Scanner class | |
Scanner scan = new Scanner(System.in); | |
String s = scan.next(); | |
int i = scan.nextInt(); | |
//BufferedReader and InputStreamReader classes |
NewerOlder