KOTLIN / CATATAN</>↗Kotlin19 Jun 2026
In Kotlin classes, val and var are used to declare properties. val means read-only after initialization var means mutable / can be reassigned Basic example class User { val id: Int = 1 var name: String = "Alice" } Usage: fun main() { val user = User() println(user.id) // 1 println(user.name) // Alice user.name = […]
KOTLIN / CATATAN</>↗Kotlin19 Jun 2026
In Kotlin, you usually define constructors and initialize properties directly in the class header using a primary constructor. 1. Primary constructor The most common style is: class Person(val name: String, var age: Int) This defines: a class named Person a read-only property name a mutable property age a constructor that requires both values Usage: fun […]
KOTLIN / CATATAN</>↗Kotlin19 Jun 2026
In Kotlin, you create a class with the class keyword, and you create an object instance by calling the class constructor. class Person { var name: String = "Unknown" var age: Int = 0 } fun main() { val person = Person() person.name = "Alice" person.age = 25 println("${person.name} is ${person.age} years old") } Output: […]
BASIC / CATATAN</>↗Basic17 Jun 2026
A compiled Java .class file starts with a fixed header (0xCAFEBABE), followed by a pair of numbers: minor_version and major_version. The pair (commonly written as major.minor, e.g., 52.0) identifies which Java platform level the bytecode targets. The JVM uses this to decide whether it can load the class. If the class was compiled for a […]
SPRING BOOT / CATATAN</>↗Spring Boot03 Apr 2026
Virtual threads are one of the most exciting additions to modern Java. They make it much easier to write highly concurrent applications without the complexity of managing large thread pools, callbacks, or reactive pipelines. If you build applications with Spring Boot, virtual threads can help your app handle many more concurrent tasks with simpler code. […]
JDBC / CATATAN</>↗JDBC01 Apr 2026
ResultSetMetaData lets you inspect the shape of a SQL query result at runtime — for example: how many columns were returned each column’s name and label its SQL type table/schema info if available whether values can be null, are auto-incremented, etc. Basic usage package org.kodejava.jdbc; import java.sql.*; public class MetaDataExample { public static void main(String[] […]