هذا الدرس سيعلمك كيف تغتنم قوة الجافا 8 في تحسين كودك و تخفيفه
Indeed, many paradigms have been added to Java Language : 
1.Methods and lambdas as first-class citizens  : 
  OLD: 
:
NEW :
2. GUI event handling :
OLD:
:
NEW :
button.setOnAction((ActionEvent event) -> label.setText("Sent!!"));
______________
سنتابع بإذن الله
:
File[] hiddenFiles=new File(".").listFiles(new FileFilter(){
    public boolean accept(File file){
           return file.isHidden();
    }
});
NEW :
File[] hiddenFiles=new File(".").listFiles(File::isHidden);
2. GUI event handling :
OLD:
:
Button button = new Button("Send");
button.setOnAction(new EventHandler<ActionEvent>() {
     public void handle(ActionEvent event) {
                label.setText("Sent!!");
     }
});
NEW :
button.setOnAction((ActionEvent event) -> label.setText("Sent!!"));
______________
سنتابع بإذن الله





 
No comments:
Post a Comment