Java White Box Testing—I/O Feature–Must Know-12

    0
    93
    Spread the love
    • 1
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
      1
      Share

    The ________ method helps in clearing the buffer.
    Ans : flush( ).
    The System.err method is used to print error message.
    True.
    False.
    Ans : a.
    What is meant by StreamTokenizer?
    Ans : StreamTokenizer breaks up InputStream into tokens that are delimited by sets of characters.
    It has the constructor : StreamTokenizer(Reader inStream).
    Here inStream must be some form of Reader.
    What is Serialization and deserialization?
    Ans : Serialization is the process of writing the state of an object to a byte stream.
    Deserialization is the process of restoring these objects.
    30) Which of the following can you perform using the File class?
    a) Change the current directory
    b) Return the name of the parent directory
    c) Delete a file
    d) Find if a file contains text or binary information
    Ans : b and c.
    31)How can you change the current working directory using an instance of the File class called FileName?
    FileName.chdir(“DirName”).
    FileName.cd(“DirName”).
    FileName.cwd(“DirName”).
    The File class does not support directly changing the current directory.
    Ans : d.

    Don't miss out!
    Subscribe To Newsletter

    Receive top technical news, lesson ideas, travel tips and more!

    Invalid email address
    Give it a try. You can unsubscribe at any time.

    Spread the love
    • 1
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
      1
      Share

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here