Wow! Data classes are awesome! I really like how classes are handled in Kotlin. However, data classes are the pinnacle of that work. The goal of this tutorial is to convert the following Java class to Kotlin:
package i_introduction._6_Data_Classes;
import util.JavaCode;
public class JavaCode6 extends JavaCode {
public static class Person {
private final String name;
private final int age;
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
}
}
from DZone.com Feed https://ift.tt/2Kf39vO
No comments:
Post a Comment