Reflection API is a collection of classes and interfaces given by SUN ,to get a meta data of a class at runtime. For example, we have a runtime class and
Every time a class was loaded into JVM , JVM creates a java.lang.Class object with the name ‘class’ in that class , that contains all the meta data of loaded
In this article we wre going to learn how to get class name of given object. package com.java; public class Sample { public void printClassName(Class c){ String cname = c.getName();
In this tutorial we are going to check wheather loaded class is an interface definition or class definition . To check weather the .class file is as interface definition or
In this tutorial we are going to learn , how to get all super classes of a class . To get super class of a class , getSuperclass() method was
In this tutorial we are going to learn hot get interfaces implemented by class at run time . To get interfaces implemented by class , getInterfaces() method was provided in
In this tutorial we are going to learn how to get all fields of a class . To get fields of a class , getDeclaredFields() method was provided in java.lang.Class
In this tutorial we are going to learn how to get constructor and it’s parameter of a class . See the below example . package com.java; import java.lang.reflect.Constructor; class Sample
In this tutorial we are going to learn how to get method details of a class . In java, methods are classified into two types they are . 1) Instance
Package is collection of classes , interfaces and sub packages. Package must be a first statement of a class. To get package details getPackage() method is given in java.lang.Class .
In java, many modifiers are there, those are: 1) private2) protected3) public4) default5) Abstract6) Final7) Synchronised8) Volatile9) Static10) Native11) Transient default is not a keyword. If you don’t specify any
In real time programming , Some times we need to group individual objects into single unit . We can achieve this using arrays . But arrays have below limitations .
1) Collection interface is child of Iterable interface . 2) Collection interface provided the most common methods , which can be applied for any collection object 3) Following is the
Multitasking : Executing multiple tasks at the same time is called multi tasking . Here task can be program . Even multi tasking and multi processing words are being used
A thread is an independent path of execution of a program. We can run multiple threads simultaneously within a program . A thread can be in one of the below
We can create thread in the following two ways . 1) By extending Thread class2) By implementing Runnable interface In this tutorial we are going to learn how to create