• Register
0 votes
36 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

1 Answer

0 votes

Solution:

 

Correct file name is :

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

Hope you got it.

7 4 2
10,530 points

Related questions

1 vote
1 answer 327 views
327 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 Gavin 15.3k points
0 votes
1 answer 12 views
12 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 maddi86 5.4k points
1 vote
1 answer 26 views
26 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 ArifulIslam 5.7k points
0 votes
1 answer 43 views
43 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 maddi86 5.4k points
0 votes
1 answer 17 views
17 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 maddi86 5.4k points