Table creation/Postal addresses: Difference between revisions

Content added Content deleted
(New post.)
m (Minor code improvement.)
Line 428: Line 428:


public static void main(String[] args) throws IOException {
public static void main(String[] args) throws IOException {
Path path = Path.of("addresses.dat");
Address[] addresses = new Address[] {
Address[] addresses = new Address[] {
new Address("FSF Inc.", "51 Franklin Street", "Boston", "MA", "02110-1301"),
new Address("FSF Inc.", "51 Franklin Street", "Boston", "MA", "02110-1301"),
Line 435: Line 434:
};
};
Path path = Path.of("addresses.dat");
FileChannel fileChannel = FileChannel.open(path, StandardOpenOption.CREATE,
FileChannel fileChannel = FileChannel.open(path, StandardOpenOption.CREATE,
StandardOpenOption.READ,
StandardOpenOption.READ,