From the course: Scala Essential Training for Data Science

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Challenge Intro: Define a Class

Challenge Intro: Define a Class

- [Instructor] In this Coder Pad challenge, we're going to create a class and a value of that type of class. Now, the class we're going to create is called person. And it's going to have the attributes of name, age, and occupation. Name and occupation will be string, while the age will be an integer. Next, we'll create a value called person1 that will have the instance with the following values. The name will be Alice, the age will be 29, and the occupation will be data scientists.

Contents