adplus-dvertising
frame-decoration

Question

What will be output for the following code?
    import java.io.*;
    class files 
    {
        public static void main(String args[]) 
        {
            File obj = new File(""/java/system"");
            System.out.print(obj.getName());
        }
    }

a.

java

b.

system

c.

java/system

d.

/java/system

Posted under Java Programming

Answer: (b).system

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be output for the following code?

Similar Questions

Discover Related MCQs

Q. ___________ returns true if called on a file and returns false when called on a directory.

Q. ObjectFilter is a member of java.io package.

Q. Which method is used to write an array of byte to the current output stream?

Q. Which method is used to write a byte to the current output stream?

Q. In java, how many streams are created for us automatically?

Q. Can we perform file handling in Java by Java I/O API?

Q. Java I/O is used to process the?

Q. ___________ method is defined in Graphics class, it is used to output a string in an applet.

Q. paint() is an abstract method defined in AWT.

Q. Which method causes the audio clip to replay continually?

Q. Which method is only called when the browser shuts down normally?

Q. Which method is automatically called after the browser calls the init method?

Q. Which of the following is required to view an applet?

Q. Applets are designed to be embedded within an __________.

Q. An applet is a Java class that extends the

Q. Which of these operators can be used to get run time information about an object?

Q. Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program?

Q. Which of these methods is a part of Abstract Window Toolkit (AWT) ?

Q. Which of these methods can be used to output a string in an applet?

Q. Which of these functions is called to display the output of an applet?