Difference Between Method and Constructor | Java Interview Questions | Ask Java | Code Bode

preview_player
Показать описание
#methodvsconstructorinjava #javainterviewquestionsandanswers #askjava

Hi Guyz,
In this video, we will understand the difference between constructor and method in java. these 5 differences will help you crack the interview question easily. Watch the video for detailed differences.

HAPPY LEARNING!
Рекомендации по теме
Комментарии
Автор

What is wrong in the following code?

class Test{

public static void

main(String[]args){

A a=new A();
a.print();

}
}
class A{
String s;
A(String s){
this.s=s;
}
public void print(){
System.out.print(s);
}
}

natinetson
join shbcf.ru