Cần chú ý rằng interface khi khai báo trong class thì có thể là default, public, private, protected. Không giống khi ta khai báo 1 interface độc lập thì chỉ có thể là public
import
java.util.*;
class
Test
{
interface
Yes
{
void
show();
}
}
class
Testing
implements
Test.Yes
{
public
void
show()
{
System.out.println(
"show method of interface"
);
}
}
class
A
{
public
static
void
main(String[] args)
{
Test.Yes obj;
Testing t =
new
Testing();
obj=t;
obj.show();
}
}
import
java.util.*;
class
Test
{
protected
interface
Yes
{
void
show();
}
}
class
Testing
implements
Test.Yes
{
public
void
show()
{
System.out.println(
"show method of interface"
);
}
}
class
A
{
public
static
void
main(String[] args)
{
Test.Yes obj;
Testing t =
new
Testing();
obj=t;
obj.show();
}
}
If you're trying to lose kilograms then you need to get on this totally brand new custom keto meal plan.
Trả lờiXóaTo design this service, licensed nutritionists, fitness trainers, and professional cooks united to develop keto meal plans that are powerful, painless, price-efficient, and delicious.
From their launch in January 2019, 100's of people have already completely transformed their figure and health with the benefits a certified keto meal plan can give.
Speaking of benefits; in this link, you'll discover 8 scientifically-proven ones provided by the keto meal plan.