• Register
0 votes
119 views

Problem:

Which of the following will open a file named MyFile.txt and allow you to read data from it?

a.	File file = new File("MyFile.txt");

b.	Scanner inputFile = new Scanner("MyFile.txt");

c.	File file = new File("MyFile.txt");
Scanner inputFile = new Scanner(file);

d.	PrintWriter inputFile = new PrintWriter("MyFile.txt");

Does any one know correct file name?

7 5 3
5,380 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution:

 

Correct file name is :

File file = new File("MyFile.txt");
Scanner inputFile = new Scanner(file);

Hope you got it.

8 6 2
10,530 points

Related questions

0 votes
1 answer 34 views
34 views
Problem: I am new, I need help, can anyone help me? Which of the following consists of rules and standards that define how a database organises data? Data handling Data model Attribute OODB
asked Feb 18, 2020 maddi86 5.4k points
0 votes
1 answer 1 view
1 view
Problem: Is there someone who can assist me in resolving this issue? Which of the following input fields allow the user to select multiple values
asked Mar 30 tuhin1 46.7k points
1 vote
1 answer 906 views
906 views
Problem: Hello Pal, I have a query regarding the python programming language. The question is, which method will return an empty string when it has attempted to read beyond the end of a file? Do you have any idea about this? Thanks
asked Mar 16, 2020 Gavin 15.3k points
0 votes
1 answer 132 views
132 views
Problem: I am new in programming and my syntax is not good, can anyone provide the right query to find? Which of the following will format 12.78 to display as 12.8%? a. System.out.printf("%2.1d%", 12.78); b. System.out.printf("%.2f%%", 12.78); c. System.out.printf("%1.2d%", 12.78); d. System.out.printf("%.1f%%", 12.78);
asked Feb 17, 2020 maddi86 5.4k points
1 vote
1 answer 66 views
66 views
Problem: Which of the following allows users to add, change, delete, or retrieve data in a database? a) Attribute generation b) Report generation tools c) Data dictionary d) Query wizard tool e) Data manipulation language
asked Mar 23, 2020 ArifulIslam 7.5k points
0 votes
1 answer 42 views
42 views
Problem: Declare a reference variable of type File named myFile?
asked Apr 6, 2020 ArifulIslam 7.5k points
0 votes
1 answer 165 views
165 views
Problems:- Can any one help with one of the query I am facing in declaring variable type Declare a reference variable of type File named myFile. Any Idea
asked Feb 13, 2020 maddi86 5.4k points
0 votes
1 answer 23 views
23 views
Problem: Can anyone help it was actually asked in exam as following: Which of the following commands would allow you to see if a remote computer is reachable? 1) ipconfig 2) netstat 3) ifconfig 4) ping
asked Feb 18, 2020 maddi86 5.4k points
0 votes
2 answers 36 views
36 views
Problem: Data is read from physical hard drives in concentric circles known as which of the following?
asked Apr 6, 2020 ArifulIslam 7.5k points
0 votes
1 answer 3 views
3 views
Problem: Can someone please help fix this, I am new and can`t figure it out.
asked Mar 29 Jack20 2.7k points