class Sub
{
public static void main(String[] args)
{
System.out.println("Hello World!");
new A().aa();
}
}
class A
{
public void aa()
{
int x=0,i=0,j=0;
String[] a = new String[]{"aa","bb","cc","dd","ff"};
String[] b = new String[]{"bb","ff"};
for(i=0;i<b.length;i++){
for(j=0;j<a.length;j++)
{
if(b[i].equals(a[j]))
{
x++;
}
// System.out.println(x);
if(x==b.length){
System.out.println("b的元素都包含在a中,自动跳出");
return;
}
}
}
System.out.println("b的元素不都包含在a中");
}
}应该是这样的吧 |