Last active
August 29, 2015 13:57
-
-
Save danidiaz/9707134 to your computer and use it in GitHub Desktop.
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
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.function.Function; | |
| public class Main { | |
| public Main() { | |
| } | |
| public static void main(String[] args) { | |
| Wee wee = new Wee(); | |
| int a = wee.foo(); | |
| System.out.println(a); | |
| List<Wee> weeList = new ArrayList<>(); | |
| // local class | |
| class Foo { int calc() { return 55; } } | |
| System.out.println(new Foo().calc()); | |
| Function<Integer,Boolean> f = i -> Boolean.TRUE; | |
| System.out.println(f.apply(5)); | |
| File file = new File("."); | |
| // FileName filter | |
| file.listFiles((File ff, String str) -> ff.isDirectory()); | |
| file.listFiles((ff,str) -> ff.isDirectory()); | |
| // FileFilter | |
| file.listFiles((File ff) -> ff.isDirectory()); | |
| file.listFiles(ff -> ff.isDirectory()); | |
| file.listFiles(File::isDirectory); | |
| Arrays.asList(4,3,2,1).stream().forEach(x -> System.out.println(x)); | |
| Arrays.asList(4,3,2,1).forEach(x -> System.out.println(x)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment