krmate21
Version:
it is created by kiran
34 lines (29 loc) • 473 B
JavaScript
class Test
{
no;
name;
constructor()
{
this.no=90;
this.name="CDSFD";
}
// constructor(num, nm)
// {
// // console.log("Inside constructor");
// // console.log(num);
// // console.log(nm)
// this.no = num;
// this.name = nm ;
// }
Print()
{
console.log(this.no + this.name);
console.log(this.no);
console.log(this.name);
}
}
var obj1=new Test();
//var obj1=new Test("34","wsf");
//obj1.name="Mahesh";
//obj1.no="cdsvds";
obj1.Print();