filmov
tv
what is the difference between constructor and method core java interview questions and answers

Показать описание
Core Java Interview Questions and Answers :
What is the difference between 'constructor' and 'method ' ?
Constructor will be automatically invoked when an object is created whereas method has to be called explicitly.
Public class ClassDemo {
ClassDemo(){
}
Display(){
}
Public static void main(String[] args){
ClassDemo demo = new ClassDemo();
demo.Display()
}
}