ODNYX.
Tutorials
Java
CSS
Database
DevOps
Spring
Design Patterns
References
Subscribe
Java
CSS
Database
DevOps
Spring
Design Patterns
Classes and Objects — Quick Check
1. What is the relationship between a class and an object?
They're the same thing, just different names
A class is a blueprint; an object is an instance created from it
An object defines the structure; a class is a copy of it
A class can only ever create one object
2. If you write `Car myCar = new Car();`, what does `new Car()` do?
Declares a variable named Car
Creates a new object and returns a reference to it
Deletes the previous Car object
Defines the Car class
Check answers
❮ Home
Next: Compile-time Polymorphism ❯