Question: Answer all questions 1) What ls encapsulation? How do you achieve encapsulation with classes?(pt 2) What information do you place in the data declarations? (1
Answer all questions 1) What ls encapsulation? How do you achieve encapsulation with classes?(pt 2) What information do you place in the data declarations? (1 pt) a What is the scope of the data defined in this area of a class? (1 pt) 3) Create a class to represent an object-Stapler (Stapler.java e for the attributes/states of the Stapler class (1 pt) L What are the possible states of the Stapler class? (1 pt) lattributes/variables) b Determine and write the Java code for the behaviors of the Stapler class. (3 pts) c Add the following methods to your Stapler object i getStaple (1pt) (coud be a part of b i setstaple (1 pt) Icould be a part of b ik. Overload one of your methods within the Stapier dass (2 pt) 1. Example: setStaple) that accepts zero and one parameter iv. At least two of your methods should be pubically visible (2 pts) v. At least two of your methods should be privately visible (2 pts) d. Add two constructors for the Stapler class (1 pt) Create a UML dagram of your created Stapler dlass. Please use only Visio or Word to create the UML diagram. If you would lke to use a dfferent dagramming tool, pleose contact me.(6 pts) 4) S) What are three possible method modfiers? (1 pt) 6) Create a driver program called StaplerDemo Create three stapler objects in StaplerDemo. (2 pts) When you have completed the ass ignment, you wilt submit two Java fles Stapler and StaplerDemo). Wehin Stapler and StaplerDemo, please use comments to indicate which pieces of code arn wer the above questions Example public void setStopler0/3.c Pease upload 84 fthe UML diagram) with your two lava dasses Please make sure your program runs without runt me and/or compler errors , a m-, a%at t you program does not compile and/or lacks comments (both in the class and the header), 1 wil not grade our asMenment MacBook Pro 5 6 7 9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
