Created
October 22, 2017 14:03
-
-
Save venkatsgithub1/aa76231bd70fcedec88d3ac8aadbbcc5 to your computer and use it in GitHub Desktop.
A small introduction to lambdas in Java: Person class
This file contains 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
package demo.java.lambdas; | |
public class Person { | |
private String name; | |
private int age; | |
public Person(String name, int age) { | |
this.name = name; | |
this.age = age; | |
} | |
public String getName() { | |
return this.name; | |
} | |
public int getAge() { | |
return this.age; | |
} | |
@Override | |
public String toString() { | |
return "Person: Name-> " + this.name + " Age-> " + this.age; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment