6. Expressions, Functions, and Object Literals

Almost everything in JavaFX is an expression, even things that you would ordinarily not think of as an expression, such as an if statement or a for statement. In fact, we probably shouldn’t even call them “statements” because they can both return a value and be used as part of another expression. The first part of this chapter discusses JavaFX expressions with the more limited meaning of expressions in other languages like Java. You’ll see all the operators that are available in JavaFX and the data types to which they can be applied. The second part of this chapter takes a closer look at JavaFX functions, which are more powerful than Java methods in the sense that they can appear outside class definitions, ...

Get JavaFX™ Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.