Package util.io

Class TextFileWriter

java.lang.Object
util.io.TextFileWriter
All Implemented Interfaces:
java.io.Serializable

public class TextFileWriter
extends java.lang.Object
implements java.io.Serializable
Author:
JIBOYE OLuwagbemiro Olaoluwa
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    TextFileWriter​(java.lang.String filePath)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getFilePath()  
    static void main​(java.lang.String[] args)  
    void setFilePath​(java.lang.String filePath)  
    void write​(java.lang.Object obj)
    Writes object data to the file
    static void writeText​(java.io.File file, java.lang.String text)
    Writes object data to the file

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TextFileWriter

      public TextFileWriter​(java.lang.String filePath)
  • Method Details

    • write

      public void write​(java.lang.Object obj)
      Writes object data to the file
      Parameters:
      obj - The data to be written.
    • writeText

      public static void writeText​(java.io.File file, java.lang.String text)
      Writes object data to the file
      Parameters:
      file - The file
      text - The data to be written.
    • getFilePath

      public java.lang.String getFilePath()
    • setFilePath

      public void setFilePath​(java.lang.String filePath)
    • main

      public static void main​(java.lang.String[] args)