Java : Class and Object - Exercises and Solution


1. Write a Java program to print message using class

View Solution

2. Write a Java program to get the simple name of the class

View Solution

3. Write a Java program to print the class loader of the given class

View Solution

4. Write a Java program to get the list of methods of a class

View Solution

5. Write a Java program to get the package name of a class

View Solution

6. Write a Java program to Create an array of objects

View Solution

7. Write a Java program to Find area of a circle using class

View Solution

8. Write a Java program to Find perimeter of a circle using class

View Solution

9. Write a Java program to Create members with private access modifier

View Solution

10. Write a Java program to Create members with access modifier

View Solution

11. Write a Java program to pass an object as an argument

View Solution

12. Write a Java program to get the class name using the object of the class

View Solution

13. Write a Java program to create an object of a class as a data member in another class

View Solution

14. Write a Java program to Implement default constructor

View Solution

15. Write a Java program to Implement the parameterized constructor

View Solution

16. Write a Java program to Implement constructor overloading

View Solution

17. Write a Java program to Implement copy constructor

View Solution

18. Write a Java program to demonstrate the instanceof operator

View Solution

19. Write a Java program to create an anonymous object

View Solution

20. Write a Java program to create a singleton class with method name as that of class

View Solution

21. Write a Java program to call a method using the anonymous object

View Solution

22. Write a Java program to call static block using the anonymous object

View Solution

23. Write a Java program to check anonymous class using isAnonymousClass() method

View Solution



Basic Programs