Home > Programming > Java Programming
Closures for the Java Programming Language TS2294 JavaOne 2007
Sort Desciption:2007 JavaOne. SM. Conference | Session TS2294 |. Session TS2294. Closures for the Java. Programming Language. Neal Gafter. Google. YOUR LOGO ...
Content Inside:Closures for the Java Programming Language TS2294 JavaOne 2007Page 12007 JavaOneSMConference | Session TS2294 |Session TS2294Closures for the JavaProgramming LanguageNeal GafterGoogleYOUR LOGOHEREPage 22007 JavaOneSMConference | TS2294 |2Why Add Closures? In another thirty years people will laugh at anyonewho tries to invent a language without closuresjust as they'll laugh now at anyone who tries to inventa language without recursion.Mark Jason DominusPage 32007 JavaOneSMConference | TS2294 |3OutlineGoals DefinitionsExisting SolutionsRequirementsSpecificationExamples New APIsPage 42007 JavaOneSMConference | TS2294 |4OutlineGoals DefinitionsExisting SolutionsRequirementsSpecificationExamples New APIsPage 52007 JavaOneSMConference | TS2294 |5GoalsConcise function literalsWithout the pain of anonymous instancesInteroperate with existing APIsEnable control APIsFunctional and aggregate operationsSimple but powerfulPage 62007 JavaOneSMConference | TS2294 |6Definition: ClosureA closure is a function that refers to free variablesin its lexical context.A function is a block of code with parameters.It may produce a result value.A free variable is an identifier used but not definedby the closure.Page 72007 JavaOneSMConference | TS2294 |7Definition: Control APIAPIspecific statement formsSpecial methods invocationsOn par with builtin statementsPage 82007 JavaOneSMConference | TS2294 |8OutlineGoals DefinitionsExisting SolutionsRequirementsSpecificationExamples New APIsPage 92007 JavaOneSMConference | TS2294 |9Example: ForEachinterface OneArg<A> {void invoke(A arg);}<T> void forEach(Collection<T> c OneArg<T> block) {for (Iterator<T> it = c.iterator();c.hasNext();) {block.invoke(it.next());}}Using anonymous instancesPage 102007 JavaOneSMConference | TS2294 |10Example: ForEachfor (String s : strings) doThing(s);forEach(strings new OneArg<String>() {public void invoke(String s) {doThing(s);}});DesiredActualPage 112007 JavaOneSMConference | TS2294 |11E ...
Source: developers.sun.com
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Related Files
<>An Introduction to Java Programming
Filed under: Programming and Java ProgrammingType java Welcome to run the program. A sample run of ... You can run the Java program from the DOS prompt using. the java command. ...
Java Server Programming: Principles and Technologies
Filed under: Programming and Java Programminglargescale serverside applications using the Java programming language. ... Professional java server programming J2EE edition. Wrox Press Inc. ...
Java Programming Language SL275
Filed under: Programming and Java Programminglanguage; objectoriented programming. with the Java programming language; and ... SL275: Java Programming Language. 2 of 5. Sun Educational Services ...
Java 2 Enterprise Edition (J2EE) Certificate Program
Filed under: Programming and Java Programmingthat are available with the Java programming language. and development environment. .... database tasks and transactions from a Java program. ...
Programming mobile devices with J2ME
Filed under: Programming and Java ProgrammingJava's interfaces, with the possibility of using a layer programming structure in ... For example the access to a built-in camera in a mobile phone by means of ...
