Write a java program to print super class hierarchy at a current class which is passed from command prompt?
11:18:00 PM | Comments (0)
class Hierarchy { public static void main(String[] args) { if (args.length == 0) { System.out.println("PLEASE PASS THE CLASS NAME..!"); } else { try...
Write a java program to find name of the class and its super class name by passing the class name at runtime?
11:01:00 PM | Comments (0)
class Ref1 { public static void main(String[] args) { if (args.length == 0) { System.out.println("PLEASE PASS THE CLASS NAME..!"); } else { ...
Write a java program to print name of the current class and its super class name?
10:54:00 PM | Comments (0)
class First { public static void main(String[] args) { String s = new String("HELLO"); printSuperclass(s); } static void printSuperclass(Object s) { Class c = s.getClass(); ...
Assertions in Java
9:31:00 AM | Comments (0)
Assertions has introduced in 1.4 version. The main objective of assertions is to perform debugging. The traditional way of debugging is to use...