I am trying to return the user name to second class, which I have set, even when getName It's called zero, returned. What am I doing wrong?
Public Sector Investor {Private String First Name; Personal string last name; Public string getName () {return firstName + "" + lastName; } Public Zero Setnam (Int User Indexes) {ArrayList & lt; String & gt; First name name = new Arasuachi & lt; String & gt; (); ArrayList & LT; String & gt; LastNameList = New Array's & lt; String & gt; (); String line = ""; {Try FileReader fr = New FileReader ("investments.txt"); Buffett reader BR = new buffed reader (FR); While ((line = br.readline ()) = null) {line.split ("\\ s +"); FirstNameList.add (line.split ("\\ s +") [3]); LastNameList.add (line.split ("\\ s +") [4]); }} Hold (IOException e) {System.out.println ("File not found!"); } This.firstName = firstNameList.get (userIndex); This.lastName = lastNameList.get (userIndex); }
No comments:
Post a Comment