final File file = new File("file.txt");
val file = File("file.txt")
public final class User {
}
class User
public class User {
}
open class User
final class User {
private final String name;
public User(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
class User(val name: String)
final class User {
private String name;
public User(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
class User(var name: String)
final class User {
private String name;
private String lastName;
public User(String name) {
this(name, "");
}
public User(String name, String lastName) {
this.name = name;
this.lastName = lastName;
}
// And Getters & Setters
}
class User(var name: String, var lastName: String = "")
public class Document {
private String id = "00x";
public String getId() {
return id;
}
public void setId(String id) {
if(id != null && !id.isEmpty()) {
this.id = id;
}
}
}
class Document{
var id : String = "00x"
set(value) {
if(value.isNotEmpty()) field = value
}
}
public abstract class Document{
public abstract int calculateSize();
}
public class Photo extends Document{
@Override
public int calculateSize() {
}
}
abstract class Document {
abstract fun calculateSize(): Int
}
class Photo : Document() {
override fun calculateSize(): Int {
}
}
public class Document {
private static final Document INSTANCE = new Document();
public static Document getInstance(){
return INSTANCE;
}
}
object Document {
}
public class ByteArrayUtils {
public static String toHexString(byte[] data) {
}
}
final byte[] dummyData = new byte[10];
final String hexValue = ByteArrayUtils.toHexString(dummyData);
fun ByteArray.toHex() : String {
}
val dummyData = byteArrayOf()
val hexValue = dummyData.toHex()
public class Documment {
class InnerClass {
}
}
class Document {
inner class InnerClass
}
public class Documment {
public static class InnerClass {
}
}
class Document {
class InnerClass
}
public interface Printable {
void print();
}
public class Document implements Printable {
@Override
public void print() {
}
}
interface Printable{
fun print()
}
class Document : Printable{
override fun print() {
}
}