created: 7/17/99; revised 7/03/2011, 05/15/2015


Fill in the Blanks

Instructions:   This is a fill-in-the-blank exercise. Each question consists of a sentence with one or two words left out. For each question, think of the word or phrase that should fill each blank, then click on the blanks to see if you are correct.


1. A _______________ file is a text file in the Java language created by a programmer with a text editor.

    A _______________ file is a file of machine language for the Java virtual machine created by a Java compiler.


2. Pick the correct braces, left brace { or right brace } in the following program.

  public class Bye  
   
     public static void main ( String[] args )   
     
      System.out.println("Hello");  
     
   

3. The   _______________   method is where a program starts running.


4. A   _______________ error is a "grammatical error" in using the programming language.


5. In creating a program you need to frequently revise the source file, compile new bytecodes, and run the program to see the result. This process is called the _______________ , _______________ and _______________ cycle.


6. Say that your program was compiled without problems, but when your run it something goes wrong. This is called a _______________ .


7.Your assignment is to create a program that writes the following lines on the computer monitor:

She walks in beauty, like the night
   Of cloudless climes and starry skies;
And all that’s best of dark and bright
   Meet in her aspect and her eyes.

Complete the program so that it performs as required.

public class Byron
{  
  public static void main ( String[] args )  
  { 
    System.out.println( _____________________________ ); 
    System.out.println( _____________________________ ); 
    System.out.println( _____________________________ ); 
    System.out.println( _____________________________ ); 
  }
}

8. An _______________ is a Java bytecode program that runs on a on a computer.


9. Here is a poorly indented program. Suggest a better way to intent the program by clicking on code where further indenting is needed.

public class Percy
{
public static void main ( String[] args )
{
System.out.println("I arise from dreams of thee");
System.out.println("In the first sweet sleep of night");
System.out.println("When the winds are breathing low,");
System.out.println("And the stars are shining bright");
}
}

10. A   _______________  is an explanatory note in a program intended for a human reader but ignored by the compiler.


End of the Exercise. If you want to do it again, click on "Refresh" in your browser window.

go to home page