Untitled
Anonymous
kotlin
06/02/2022 10:25 AM
664 B
42
Indexable
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val student = Student(this)
student.showMessage()
}
}
class Student(private val context: Context) {
init {
val student = Student(context)
student.showMessage()
}
fun showMessage() {
Toast.makeText(context, "Message", Toast.LENGTH_LONG)
}
}Editor is loading...