From the course: Data Science for Java Developers

Unlock this course with a free trial

Join today to access over 22,500 courses taught by industry experts.

Creating a person data class

Creating a person data class - Java Tutorial

From the course: Data Science for Java Developers

Creating a person data class

- [Instructor] Okay, so now that we've defined this static getLines method in our TextLoader class, let's just test it out by opening up some class with a main method in it. And I've created this TextLoading class for this example. And basically, what we're going to do is we're just going to test out to see if this getLines method works like we expect it to. So all we're going to do is we're just going to say List<String> lines = TextLoader.getLines, and we're going to try loading our adult-sample.data file from before. All right, so we're going to say adult-sample.data. And once we've done that, we're just going to print the data to make sure we're getting all of the lines from the file. So we're just going to say System.out.println(lines). And we're going to run our file here and we'll see that it prints it basically all out on one line, but that's more or less what we're looking for there. Okay, so now that we have…

Contents