Skip to content

Instantly share code, notes, and snippets.

@saqibmehmoodgit
Last active April 7, 2017 10:48
Show Gist options
  • Save saqibmehmoodgit/fd042d14d3d4f9605bc6cc49f2c101c8 to your computer and use it in GitHub Desktop.
Save saqibmehmoodgit/fd042d14d3d4f9605bc6cc49f2c101c8 to your computer and use it in GitHub Desktop.
public class Country
{ String name ;
// getter and setter
@Override
public String toString() {
return "Country [name=" + name + "]"; }
}
public class GenMethd {
public static <T> boolean getGenrcs(T t)
{
System.out.println(" class name "+t.getClass().getSimpleName());
System.out.println(" country with toString "+t);
// Country.getName();
}}
/// Main Methods
Country c = new Country();
boolean s= GenMethd.getGenrcs(c);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment