package com.sudhirtheindian2.java123;
public class ParaConstructor {
int x;
String y;
ParaConstructor(int a , String b){
x=a;
y=b;
// System.out.println(a+b);
}
void sum(){
System.out.println(x+y);
}
public static void main(String[] args) {
ParaConstructor pc = new ParaConstructor(4,"india");
pc.sum();
// What is parameterized constructor in java
// a constructor through which we can pass one or more
// parameters is called parameterized constructor
// syntax
// class A(){
// A(int a, String b){
//
// }
// }
}
}
Computer Storage Units Converter Computer Storage Units Converter From: Bytes Kilobytes Megabytes Gigabytes Terabytes Value: To: Bytes Kilobytes Megabytes Gigabytes Terabytes Convert
टिप्पणियाँ
एक टिप्पणी भेजें