Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Part 1: Defining the Class Write the code to create a class that models a Door o

ID: 3761628 • Letter: P

Question

Part 1: Defining the Class Write the code to create a class that models a Door object. Don't worry about the internal details just yet. Just give the class a name and an empty body for the moment. We will add more to the class shortly. For example, if we were creating a class to represent a Window, we would use the following: Part 2: Instance Variables When modeling an object as a class, we also need to describe the properties it possesses. An everyday object that we wish to model always has one or more properties that describe it. For instance a door object might have a name like ''Front'' or ''Side'' to distinguish it from other doors. Another property that could describe a door is its state: ''open'' or ''closed''. Properties of objects are described in code by using nouns like ''state'' or ''name'' to create instance variables that hold values. Add the following two instance variables to your Door class: . a String name to hold the name of the door . a String state to hold if the door is opened or closed

Explanation / Answer

//Please comment if you need something else

public class Door{
    String name;
    String state;
}