Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Complete the following driver by accomplishing the TO-DOs

Code Block
languagejava
package MementoLabOne;

public class Lab1 {
    public static void main(String[] args) {
        //TODO Create a new instance of the Document class
    
        //TODO  Create a new instance of the History class
        
        //TODO set the content of the Document instance to "Hello".
       
        //TODO  save the current state of the Document instance into the History instance by
        // creating a memento of the document and pushing it onto the history.
        

        //TODO  change the font of the Document instance and save the state to History.
        

        //TODO  line sets the font size of the Document instance to 10, but don't save it.
       

        //TODO print the current state of the Document instance to the console.
       

        //TODO restore the Document instance to its previous state by popping the
        // last saved state from History and then print the current state of the Document
        // instance to the console.
        

        //TODO Again, restore the Document instance to its previous state by popping the
        // last saved state from History and then print the current state of the Document
        // instance to the console.
        
    }
}

...