with the help of private constructor you can add a constraint in your class that nobody can create the object of your class outside the class. coz constructor is visible only inside the class.
Subscribe to:
Post Comments (Atom)
What is Map Collection?
A map collection refers to a set of maps that are compiled and organized for a specific purpose, such as research, education, or preservatio...
-
Sure, here is an example program in Java that swaps two characters in a string: public class StringSwapExample { public static void main...
-
Comparator Interface: Java Comparator Comparator is a interface in java which is available in java.util package. Comparator is used to sort...
-
// * execute without main method Program *// class Maind { static { System.out.println("Hello execute without main method."); ...
No comments:
Post a Comment