write one java program using constructor.
Answers
Answered by
0
Answer:
A constructor in Java is similar to a method that is invoked when an object of the class is created. Unlike Java methods, a constructor has the same name as that of the class and does not have any return type. For example, class Test { Test() { // constructor body } } Here, Test() is a constructor.
Explanation:
hope it's help
Similar questions
English,
21 hours ago
Biology,
21 hours ago
Hindi,
1 day ago
Science,
1 day ago
Computer Science,
8 months ago