Unlock the full course today
Join today to access over 15,000 courses taught by industry experts or purchase this course individually.
Want to get more out of the Java language and platform? In this platform- and framework-neutral course, instructor Bethan Palmer digs into some of the language’s more advanced features, helping you expand your programming skills as she equips you with techniques you can use when building applications anywhere Java is used: in web, mobile, and desktop applications. Bethan covers a variety of topics, including generics, working with the Collections Framework, and functional programming. Plus, learn about I/O in Java, working with files and directories, and structuring applications using the modular system available in Java.
Software Developer and Java Champion
Skills covered in this course
Learn advanced Java programming“
- [Instructor] Method references are a shorthand way of writing a certain type of lambda expression. If you have a lambda expression that passes in a variable and then calls a method on that variable, you can replace it with a method reference. In this example, I have a class called square. This class has one private field of type int called side length. And a public calculate area method, which calculates the area by multiplying side length by side length. The constructor of the square class specifies that I have to pass in an int for the side length value. I also have a functional interface called shapes. This has a single abstract method called get area. Finally, I have a main class. In the main method of the main class, I create a new square object with a side length of four. Then, I implement the shapes interface and overrides the get area method using a lambda. Inside the lambda, I just return the result of calling the calculate area method on my square object. Finally, I have a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Download the exercise files for this course. Get started with a free trial today.
Download courses and learn on the go
Watch courses on your mobile device without an internet connection. Download courses using your iOS or Android LinkedIn Learning app.
Watch this course anytime, anywhere. Get started with a free trial today.