Untitled

 avatar
unknown
kotlin
3 years ago
498 B
25
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...