Computer Science > STUDY GUIDE > LockDataStructureClass.java-REVIEWED BY EXPERTS (All)
import java.util.*; public class LockDataStructureClass implements LockADT { //Receive User Input Scanner keyboard = new Scanner(System.in); //Instance Variables for the Lock (Combination) priva... te int x; private int y; private int z; //Instance variable to return number currently at top private int pointer; //Boolean to Lock/Unlock private boolean status; //Default Constructor public LockDataStructureClass() { x = 0; y = 0; z = 0; pointer = 0; status = true; } //Overloaded Constructor public LockDataStructureClass(int x, int y, int z) { this.x = x; this.y = y; this.z = z; } //Set the First Number public void setX(int x) { this.x = x; //Assign value of X to Pointer pointer = x; } //Set the Second Number public void setY(int y) { this.y = y; //Assign value of Y to Pointer pointer = y; } //Set the Last Number public void setZ(int z) { this.z = z; //Assign value of Z to Pointer pointer = z; [Show More]
Last updated: 1 year ago
Preview 1 out of 4 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Add to cartInstant download
We Accept:
Connected school, study & course
About the document
Uploaded On
May 28, 2021
Number of pages
4
Written in
This document has been written for:
Uploaded
May 28, 2021
Downloads
0
Views
28
In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Browsegrades · High quality services·