πŸ“Š JAVA
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
πŸ’¬ Discuss
βœ… Correct Answer: (D) false false

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

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
171
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Geetam
Publisher
πŸ“ˆ
81%
Success Rate