Assignment No.1

  1. Write a class Profile that produces the following three lines of output:
    My name is XXX.
    My hometown is YYY.
    My favorite sport is ZZZ.
    Here XXX, YYY, and ZZZ are place-holders.

  2. Find at least five errors in the following program (the line numbers are added for reference):
    1. public clas Erroneous {
    2.    public static vold main(String[] args ) {
    3.       System.out.print( "\"How can you mend " )
    4.       System.out.println( "my broken heart?\" );
    5.       System.out,print( "\"How can you stop the rain " );
    6.       System.out.println( from falling down?\"" ):
    7.    }
    8. ]

Go back to the assignment list page.