×

Java Programs

Java Practice

Java Class and Object Programs

Java solved programs based on class and objects: Here you will find programs, which are implemented using class and objects in java with solution, output and explanation.

This section contains programs on Class and Objects, here you will learn how to create classes and their instances, calling the class methods etc.

Here you will find programs from printing simple message using class to create complex classes.

List of Java Class and Object Programs

  1. Java program to print message using class
  2. Java program to find area and perimeter of a circle using class
  3. Java program to count all digits of an integer number using class
  4. Java program to find sum and product of all digits of an integer number using class
  5. Java program to check whether a given number is palindrome or not using class
  6. Java program to check whether a given number is armstrong or not using class
  7. Java program to add two distnace using class
  8. Java program to create members with private access modifier
  9. Java program to create members with access modifier
  10. Java program to create a singleton class
  11. Java program to create instances of singleton class and print hash codes
  12. Java program to compare instances of singleton class
  13. Java program to create a singleton class with method name as that of class
  14. Java program to implement cascaded method call
  15. Java program to create a method returning an object
  16. Java program to pass an object as an argument
  17. Java program to create an array of objects
  18. Java program to implement default or no-argument constructor
  19. Java program to implement the parameterized constructor
  20. Java program to implement constructor overloading
  21. Java program to implement a copy constructor
  22. Java program to implement constructor chaining
  23. Java program to create an object of a class as a data member in another class
  24. Java program to demonstrate the instanceof operator
  25. Java program to create an anonymous object
  26. Java program to call a method using the anonymous object
  27. Java program to implement cascaded method call with an anonymous object
  28. Java program to call static block using the anonymous object
  29. Java program to represent the class in different ways
  30. Java program to get the class name using the object of the class
  31. Java program to demonstrate the newInstance() method
  32. Java program to check whether an object belongs to a particular class or not
  33. Java program to check whether the specified Class object represents an interface type or not
  34. Java program to check whether the specified Class object represents a primitive type or not
  35. Java program to check whether the specified Class object represents an array or not
  36. Java program to check anonymous class using isAnonymousClass() method
  37. Java program to check whether a class is a local class or not
  38. Java program to check whether a class is a member class or not
  39. Java program to check whether a class is declared as an enum or not
  40. Java program to check an annotation type using the isAnnotation() method
  41. Java program to demonstrate the getName() method
  42. Java program to get the simple name of the class
  43. Java program to print the class loader of the given class
  44. Java program to get the name of the superclass
  45. Java program to get the name of the generic superclass
  46. Java program to get the list of implemented interfaces in a class
  47. Java program to get the package name of a class
  48. Java program to get the list of fields of a class
  49. Java program to get the list of defined classes and interfaces in a class
  50. Java program to get the list of methods of a class
  51. Java program to get the list of constructors of a class
  52. Java program to create an anonymous class by extending a class
  53. Java program to create an anonymous class by implementing an interface


Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.