import java.util.Scanner;
class orange
{
private String girlName;
public void setName(String name)
{
girlName=name;
}
public String getName()
{
return girlName;
}
public void message()
{
System.out.print("Your 1st gf name is "+getName());
}
}
class apples
{
public static void main(String args[])
{
Scanner harry=new Scanner(System.in);
String name;
System.out.print("Enter your 1st gf name here:");
name=harry.nextLine();
orange obj=new orange();
obj.setName(name);
obj.message();
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.