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 2月 2023, 01:59
Learn java programming through quizzes and videos
显示更多
我们使用 cookie 来改善您的浏览体验。
点击“全部接受”,即表示您同意Cookie 使用政策。