filter_with_getClass.htm

import java.io.*;
public class Test_This {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String str ="";
Process pp = new Process();//object is created
try{
System.out.print("Please write your name: ");
str = br.readLine();
if(pp.getClass()== Process.class){
System.out.println(pp.method_function(str)); //calling this method using object pp
System.out.println("The above came from class : " + pp.getClass().getName());
}
}//try
catch(NumberFormatException e)
{ System.out.println("data was blank");}
}

}
class Process
{
//class body
public int n1 =12; String name = "";//defined and instantiated a filed
public String method_function(String str)
{
//function body
name += str.toUpperCase();
System.out.println("You called me ?: " + str);
System.out.println("Not sure how to get back to you ?: ");
System.out.println("--------------------------");
System.out.println("Now I can get back to you ?: " );
return name;
}
}