Created
June 19, 2018 01:26
-
-
Save leesc22/220dbf51e8033f3ec0125c2e6bc6200e to your computer and use it in GitHub Desktop.
Comparison between Java class and Kotlin 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
/* Java */ | |
public class Book { | |
private String title; | |
private Long isbn; | |
public Book(String title, Long isbn) { | |
this.title = title; | |
this.isbn = isbn; | |
} | |
public String getTitle() { | |
return title; | |
} | |
public void setTitle(String title) { | |
this.title = title; | |
} | |
public Long getIsbn() { | |
return isbn; | |
} | |
public void setIsbn(Long isbn) { | |
this.isbn = isbn; | |
} | |
} |
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
/* Kotlin */ | |
class Book constructor(var title: String, var isbn: Long) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment