6.7k views
3 votes
Write one line of code to declare a 'Path' reference variable named: pathobject4 AND create the object by calling the 'Paths' class method get and passing it: C:/programs/values.dat Write one line of code to declare a Scanner reference variable named: my_input AND create the object passing the constructor the variable: fileobject3

User Yamell
by
5.8k points

1 Answer

6 votes

Answer:

Step-by-step explanation:

Using Java as the programming language of choice, the exact implementation of what is asked in the question would be the following, it would also need the file location to be exact and the imports in order to work.

import java.nio.file.Path;

import java.nio.file.Paths;

import java.util.*;

class Test

{

public static void main(String[] args)

{

Path paths = new Paths("C:/programs/values.dat");

Scanner my_input = new Scanner(fileobject3);

}

}

User Valentin Petkov
by
5.9k points