Wednesday, March 18, 2009

Exerc# 5

/*
Programmer Name: Jhovan C. Besas
Program Name:  Hello Object
Purpose: To enhance how to run a program the name echo problems
Date: March 18,2009
Instructor: Dony Dongiapon
*/

import java.util.Scanner;


public class HelloObject {

  public static void main(String[]args) {
  Scanner a = new Scanner(System.in);
  String greeting;

  System.out.print("Enter your Greeting: ");

//it is where the greeting that is printed by the object given by the user.

  greeting = a.nextLine();
  System.out.println("\n");
  System.out.print(greeting);
  System.out.println();
  }
   
   

}

--------------

//Output of this program:

Enter Greeting: 

Hello World!

Hello World!

No comments:

Post a Comment