Welcome Guest | Sign in | Register
File - Discussion Page For Q.2720 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > File > Questions and Answers

Q: What will be the result of compiling and run the following code:

public class Test {
public static void main(String... args) throws Exception {
File file = new File("test.txt");
A. create new actual file name as test.txt B. no actual file will be created.
C. Compile error. D. None of the above

Answer and Explanation

Answer:no actual file will be created.

creating a new instance of the class File, you're not yet making an actual file, you're
just creating a filename

Comment on this Question



Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved 2012-2015 SoftLucent.