Question: Here is my code:

```
public String display() {
    return "\n......................\nFixed Employee:\n" + 
           "Name: " + super.fullName() + 
           "\nSalary: " + salary() + 
           " tk\n......................";
}

```

But when I'm invoking this method from main class, "\n" newLine not working. just showing one line output. Will you plz help to solve the problem?

Thanks

Answer: 
For saving in files use `\r\n`. `\n` as new lines is viable on printstreams but not writing to files.
You may need the system independent line separator as it might differ from one OS to another. Just replace the **\n** with the value of line separator:

* I can be retrieve as you load any system property:

```java
    public String display() { 
      String separator = System.getProperty("line.separator"); // Load the system property using its key.
      return "\n......................\nFixed Employee:\n" 
        + "Name: " 
        + super.fullName() + 
        "\nSalary: " 
        + salary() 
        + " tk\n......................"
      .replace("\\n", separator); // replace the \n before returning your String 
    }

```

* Or simply use `System#lineSeparator` method as @Deepanshu Bedi suggested:

```java
    public String display() { 
      String separator = System.lineSeparator(); // Consider it as a shortcut.
      return "\n......................\nFixed Employee:\n" 
        + "Name: " 
        + super.fullName() + 
        "\nSalary: " 
        + salary() 
        + " tk\n......................"
      .replace("\\n", separator); // replace the \n before returning your String 
}

```