Created
October 7, 2014 15:47
-
-
Save yusuke/ba777e49ba3e8d3f8d03 to your computer and use it in GitHub Desktop.
This file contains 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
public class Cpu { | |
public static void main(String[] args) throws TwitterException { | |
Twitter twitter = TwitterFactory.getSingleton(); | |
// with lambda | |
IntStream.rangeClosed('a', 'Z').forEach(e -> { | |
try { | |
twitter.updateStatus(String.format("@syobochim %sカップ", (char) e)); | |
} catch (TwitterException e1) { | |
e1.printStackTrace(); | |
} | |
}); | |
// without lambda | |
for (char c = 'a'; c <= 'z'; c++) { | |
twitter.updateStatus(String.format("@syobochim %sカップ", c)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment