2个回答
展开全部
// all of dataType you wanted and put into the object array
public Object []allDataTypes(){
byte bt=127;
int it=128;
long lg=2000L;
float ft=3423.1F;
double db=23123d;
char ch='c';
boolean bn=1==1;
Object ob=new Object[]{bt,it,lg,ft,db,ch,,bn};
return ob;
}
//the enter of programm;
public static void main(String []args){
Object []ob=allDataTypes(){;
for(int index=0,size=ob.length();index++)
System.out.println(ob[index])//print the result
}
public Object []allDataTypes(){
byte bt=127;
int it=128;
long lg=2000L;
float ft=3423.1F;
double db=23123d;
char ch='c';
boolean bn=1==1;
Object ob=new Object[]{bt,it,lg,ft,db,ch,,bn};
return ob;
}
//the enter of programm;
public static void main(String []args){
Object []ob=allDataTypes(){;
for(int index=0,size=ob.length();index++)
System.out.println(ob[index])//print the result
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询