Skip to content

Instantly share code, notes, and snippets.

@sunny30
sunny30 / AccessGranted.scala
Created January 18, 2025 17:36 — forked from akjir/AccessGranted.scala
Access private fields and methods using Java Reflection in Scala.
object Main extends App {
val printer = new Printer[String]()
val break = true
val text = "access granted"
//cannot be accessed:
//printer.printCodeName
//printer.codeName = "Rejewski"
//printer.printCodeName