Find the below given code
object Main
{
def main(args: Array[String]): Unit = {
val stud = new Student("Sharon", "John", 80)
println(stud.fName + "\t" + stud.lName + "\t" + stud.marks)
val stud2 = new Student("Rekha")
println(stud2.fName + "\t" + stud2.lName + "\t" + stud2.marks)
}

class Student(val fName: String, val lName: String, val marks: Int)
{
def this(fName: String)
{
// Line 1
println("\nStudent Marks")
}
}
}
Choose the option which should be placed at Line 1 to avoid compilation error?

this(fName)

this(fName, "", 90);

this(fName,80)

this()

Correct Option - b

To get all Infosys Certified Scala Programmer Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in