Scala - Access element using underscore method Code Example

The code for Access element using underscore method

object MyClass {
    def main(args: Array[String]) {
        var person = ("Tony Robbins", "62", "Los Angeles, California, U.S.", true)
        
        println(person._1)
        println(person._2)
        println(person._3)
        println(person._4)
    }
}

/*
Output:
Tony Robbins
62
Los Angeles, California, U.S.
true
*/
Code by IncludeHelp, on August 15, 2022 22:33

Comments and Discussions!





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.