package com.sudhirtheindian2.java123;
public class javaConstructor {
int a;
String name;
boolean f;
javaConstructor(){
a=10;
name="india";
f=true;
}
void display(){
System.out.println(a+" "+name+" "+f);
}
public static void main(String[] args) {
javaConstructor jc = new javaConstructor();
jc.display();
// Types of constructor in java ----
// and what is default constructor
// 1 private constructor
// 2 default constructor
// 3 parametrized constructor
// 4 copy constructor
// what is default constructor
//
// a constructor which does not have any parameter
// is called default constructor
// syntax----
// class A{
//
// A(){
//
// }
// }
}
// syntax of default constructor
}
Computer Storage Units Converter Computer Storage Units Converter From: Bytes Kilobytes Megabytes Gigabytes Terabytes Value: To: Bytes Kilobytes Megabytes Gigabytes Terabytes Convert
टिप्पणियाँ
एक टिप्पणी भेजें