Application - tempComboLock.setId(tempInt);

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
package lab6; p public class Application { p public static void main(String[] args) { p FileRead fr = new FileRead("inheritComboData.txt"); String line = fr.readLine(); int LENGTH = 12; ComboLock [] superClass = new ComboLock [LENGTH]; ComboLock avoidNullCombo = new ComboLock(000000, "Empty"); for(int i = 0; i<LENGTH; i++) { superClass[i] = avoidNullCombo; } NameId [] childClass = new NameId [LENGTH]; NameId avoidNullNameId = new NameId("Empty"); for(int i =0; i<LENGTH; i++) { childClass[i] = avoidNullNameId; } ComboLock tempComboLock = new ComboLock(); NameId tempNameId = new NameId(); Name tempName = new Name(); N while(line!=null) { String [] tempArr = line.split(","); S if(tempArr.length == 2) { int iteration = 0; int tempInt = Integer.parseInt(tempArr[0]);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: tempComboLock.setId(tempInt); tempComboLock.setCombination(tempArr[1]); superClass[iteration] = tempComboLock; System.out.println(superClass[iteration].toString() + &quot; in super class&quot;); iteration++; line = fr.readLine(); } else { int iteration = 0; tempName.setLastName(tempArr[0]); tempName.setFirstName(tempArr[1]); tempName.setMiddleInitial(tempArr[2]); int tempInt = Integer.parseInt(tempArr[3]); tempNameId.setId(tempInt); tempNameId.setCombination(tempArr[4]); tempNameId.setNameId(tempName.toString()); childClass[iteration] = tempNameId; System.out.println(childClass[iteration].toString() +&quot; in child class&quot;); iteration++; line = fr.readLine(); } } }}...
View Full Document

Page1 / 2

Application - tempComboLock.setId(tempInt);

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online