Skip to content

Instantly share code, notes, and snippets.

View indzi's full-sized avatar

Indranil SInha indzi

  • Crypto Currency Trading
  • Singapore
View GitHub Profile
@indzi
indzi / iterating.java
Created January 16, 2016 10:52
iterating on collection
//creating iterator n for collection numbers
for(Iterator n = numbers.iterator() ;n.hasNext(); ) {
@indzi
indzi / charAt.java
Created January 12, 2016 12:24
Getting specific character from specific place of a string
//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;
}
@indzi
indzi / user_input.java
Created January 12, 2016 08:51
Taking user input in Java
//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