A

Admin • 828.03K Points
Coach

Q. What will be output for the following code? Note: file is made in c drive

Code:
import java.io.*;
class files
{
public static void main(String args[])
{
File obj = new File(""/java/system"");
System.out.print(obj.canWrite());
System.out.print("" "" + obj.canRead());
}
}
  • (A) true false
  • (B) false true
  • (C) true true
  • (D) false false
  • Correct Answer - Option(D)
  • Views: 15
  • Filed under category Java
  • Hashtags:

Explanation by: Admin
false false will be output for the following code.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.