⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shuzu.java

📁 编写一个工具程序
💻 JAVA
字号:
package tookit;

 class shuzu {
private int obj1[];
private char cobj;
private char obj2[];
private String obj3[];
private int obj;
private String str;
public shuzu(int o1[]){
	obj1=o1;
}
public shuzu(char o2[]){
	obj2=o2;
}
public shuzu(String o3[]){
	obj3=o3;
}
public int getshuzu(int a){
	for(int i=0;i<obj1.length;i++)
	{
		if(obj1[i]==a&&i<obj1.length){
			System.out.println(i);
		}
		//else{
			//System.out.println("没有");
		//}
	}
	return obj;
}
public char getshuzu(char a){
	for(int i=0;i<obj2.length;i++)
	{
		if(obj2[i]==a&&i<obj2.length){
			System.out.println(i);
		}
		//else{
			//System.out.println("没有");
		//}
	}
	return cobj;
}
public String getshuzu(String a){
	for(int i=0;i<obj3.length;i++)
	{
		if(obj3[i]==a&&i<obj3.length){
			System.out.println(i);
		}
		//else{
			//System.out.println("没有");
		//}
	}
	return str;
}
}
public class shuzuzu{
public static void main(String args[]){
int ob1[]={1,4,3,2,5,6};
char ob2[]={'a','b','e','g','d'};
String ob3[]={"agga","atgga","ttt","sjsj"};
shuzu o1=new shuzu(ob1);
shuzu o2=new shuzu(ob2);
shuzu o3=new shuzu(ob3);
o1.getshuzu(1);
o2.getshuzu('a');
o3.getshuzu("agga");
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -