1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Object-Oriented Programming in Java

Connected

Exercise

Creating car class object instance

Using classes, we can create object instances that perform operations within our code. We are going to create an instance of the Car class.

NOTE: We added a new keyword, static, on the Car class. We will learn about the static keyword later, but for now, it is required for your code to run correctly within the editor.

Instructions

100 XP
  • Create a new object instance of the Car class called myCar inside the main method of the Main class.