Yes we can create a instance in another class.
For e.g
final Class A{
int i;
public void fun(){
//Some code
}
}
class B{
int j;
A obj = new A();
public void gun(){
//Some code
}
}
09 февр. 2023, 01:59
Learn java programming through quizzes and videos
Больше
Мы используем файлы cookie для улучшения вашего опыта просмотра.
Нажав «Принять все», вы соглашаетесь с политикой использования файлов cookie.