go to previous page   go to home page   go to next page

Answer:

Another name for "actual parameter" is "argument".


Primitive Data Types as Parameters

The eight primitive data types are:

byte short int long float double char boolean

The word primitive means "a fundamental piece that is used to create other, larger parts." So far we have been using parameters with primitive data types. Here is a tiny program that reviews this:


class SimpleClass
{
  public void print( int x )
  {
    System.out.println("Value of the parameter: " + x );
  }
}

public class SimpleTester
{
  public static void main ( String[] args )
  {
    int var = 7;
    SimpleClass simple = new SimpleClass();

    System.out.println("First  value of the local var: " + var );    
    simple.print( var );
    System.out.println("Second value of the local var: " + var );    
  }
}

QUESTION 3:

What is the output of the program?

First  value of the local var: 
Value of the parameter:        
Second value of the local var: 

go to previous page   go to home page   go to next page