Click here to watch in Youtube :
https://www.youtube.com/watch?v=xaaUTIlmrhM&list=UUhwKlOVR041tngjerWxVccw
Employee.java
ObjectClassTest.java
https://www.youtube.com/watch?v=xaaUTIlmrhM&list=UUhwKlOVR041tngjerWxVccw
Employee.java
public class Employee
{
private String name;
}
import java.util.ArrayList; import java.util.HashSet; public class ObjectClassTest { public static void main(String[] args) { Employee employeeObj = new Employee(); /* * Returns the Class object that represents the * runtime class of this object. */ System.out.println("employeeObj.getClass() = " + employeeObj.getClass()); ArrayList<String> arrayListObj = new ArrayList<String>(); System.out.println("arrayListObj.getClass() = " + arrayListObj.getClass()); HashSet<String> hashSetObj = new HashSet<String>(); System.out.println("hashSetObj.getClass() = " + hashSetObj.getClass()); } }
employeeObj.getClass() = class Employee arrayListObj.getClass() = class java.util.ArrayList hashSetObj.getClass() = class java.util.HashSet
https://sites.google.com/site/javaee4321/java/ObjectClassDemo_getClass_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/ObjectClassDemo_getClass_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/8fa82bcbf36a8ef675302adced6f7a0764627bd4/BasicJava/ObjectClassDemo_getClass_App/?at=master
See also:
No comments:
Post a Comment