我想从父级调用动态创建的子方法的方法,然后将值传递给该类。
这在Java中可能吗?
Class Parent {
Child(1, 2, ..., N).someMethod();
}
//Dynamically created at any time and also deleted
Class Child1 { }
Class Child2 { }
.
.
.
Class ChildN { }
答案 0 :(得分:0)
确定
signIn() {
this.loginService.checkAuthentication(this.login).subscribe(
(resp) => {
console.log(resp.headers);
let user = resp.headers.get('info');
localStorage.setItem('user', JSON.stringify(user));
let token = resp.headers.get('x-token');
localStorage.setItem('x-token', token);
this.router.navigate(['/list']);
},
(error) => {
this.login = new Login();
console.log(error.error.message);
Swal(error.error.message, 'Try again.', 'error');
}
);
}
只需确保子对象覆盖方法callMethod();
ps:您最好在了解的域上提供一些所需的示例。第二:这不是java问题