From the course: Data Science for Java Developers
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Reducing file size5m 20s
-
(Locked)
Loading data from text files3m 29s
-
(Locked)
Creating a person data class3m 56s
-
(Locked)
Converting strings to data objects5m 39s
-
(Locked)
Loading tab-separated files9m 20s
-
(Locked)
Loading CSVs5m 21s
-
(Locked)
Converting CSVs to data objects7m 4s
-
(Locked)
Challenge: Manipulating data2m 1s
-
(Locked)
Solution: Manipulating data3m 37s
-
(Locked)
-
-
-
-