• Register
0 votes
71 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 5 2
10,530 points

Related questions

1 vote
1 answer 672 views
672 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 23 views
23 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
1 vote
1 answer 44 views
44 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 5.6k points
0 votes
1 answer 66 views
66 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
0 votes
1 answer 18 views
18 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 28 views
28 views
Problem: Data is read from physical hard drives in concentric circles known as which of the following?
asked Apr 6, 2020 ArifulIslam 5.6k points
0 votes
1 answer 28 views
28 views
Problem: Can anyone help it was actually asked in exam as following: Which of the following are the advantages of a DBMS (database management system)? A) Effective database administration helps ensure that standards for data names, formats, and documentation are followed ... processing systems. D) A DBMS is scalable which makes it easier to meet the rapidly changing needs of a business enterprise.
asked Feb 18, 2020 maddi86 5.4k points
0 votes
1 answer 42 views
42 views
Problem: Can anyone guide me with the right solution as I am new and learning database? Which of the following does not violate the referential integrity of a database? Inserting a new row into a table with a foreign key that doesn't match a primary key in ... related rows in all related tables Deleting a row in a foreign key table without deleting the related row in the related primary key table
asked Feb 17, 2020 maddi86 5.4k points
0 votes
1 answer 37 views
37 views
Problem: While creating database in relational DBMS, what we need? In a relational DBMS, a user may create a database structure that contains which of the following? A) Data,fields, and table relationships B) Symbols, numbers, and tables C) Numbers, tables, and fields D) Fields, tables, and table relationships
asked Feb 17, 2020 maddi86 5.4k points
0 votes
1 answer 38 views
38 views
Problem: Can anyone brief the right solution? Which of the following is an international standard language for processing a database? A) VBA B) C++ C) Visual Basic D) Standard Query Language E) Structured Query Language
asked Feb 17, 2020 maddi86 5.4k points