constructor types code example
Example 1: java constructor
class Huso {
public Huso() {
//constructor code about a huso
}
}
Example 2: constructor in java
public class ConstructorDemo
{
int a;
ConstructorDemo()
{
a = 26;
}
public static void main(String[] args)
{
ConstructorDemo obj = new ConstructorDemo();
System.out.println(obj.a);
}
}