Quick actions

cmd+k|ctrl+k

Navigation

Languages

KIT MotoneAdachi Batch 7 - SMART PHONE APP DEVELOPMENT TASK ON CREATING CLASSES 04/12/2019

Snippet info

Language

Kotlin

Visibility

public

Author

waricoma

Created

2019-12-04T03:29:12Z

Updated

2019-12-04T03:29:12Z

/*
Create the class 'Student' with the following properties and behavior

Properties:
rollNumber of type integer, name of type String, year of type integer, section of type character
*/

class Student {
    var rollNumber = 0
    var name = ""
    var year = 0
    var section = ""
    
    fun sing() {
        println("Singing")
    }
    
    fun learn() {
        println("Learning")
    }
    
    fun wiriteExam() {
        println("Writing Exam")
    }
    
    fun play() {
        println("Playing")
    }
}

fun main(args : Array<String>){
    var motone = Student()
    motone.name = "Motone"
    motone.year = 2000
    motone.sing()
}
INFO