hallo leute, an sich ne einfache frage:
ich soll ne methode erstellen, die alle mgl elemntaren datentypen verleicht, also byte mit short udn so was, und darauffolgend, im selben prog, ne mainmethode, die es auch macht...wie masche ich das am besten?? stehe völlig aufm schlauch, ich post mal meine bisheirigen verusche
public class convertTypes{
public static void ergenbis(){
byte[]b=new byte;
byte []b={100,100,100,100,100,100,100,100};
short []s=new short;
short[]s={10000,10000,10000,10000,10000,10000};
int []i=new int{100000,100000,100000,100000,100000,100000,100000,100000};
long []l=new long;
long []l={1000000,1000000,1000000,1000000,1000000,1000000,10000000};
float []f=new float;
float []f={5.121212f,5.121212f,5.121212f,5.121212f,5.121212f,5.121212f};
double []d=new double;
double[] d={100.1001,100.1001,100.1001,100.1001,100.1001,100.1001,100.1001};
byte bshort=(short) s[0];
byte bint=(int) i[0];
byte blong= (long) l[0];
byte bfloat= (float) f[0];
byte bdouble=(double) d[0];
short sbyte=byte b[0];
short sint=(int) i[1];
short slong=(long) s[1];
short sfloat=(float) f[1];
short fdouble=(double) d[1];
int ibyte=byte b[1];
int ishort=short s[1];
int ilong=(long) l[2];
int ifloat=(float) f[2];
int idouble=(double) d[2];
long lbyte=byte b[2];
long lshort=short s[2];
long lint=int i[2];
long lfloat= (float) f[3];
long ldouble=(double) d[3];
float fbyte=byte b[3];
float fshort=short s[3];
float fint=int i[3];
float flong=long l[3];
float fdouble=(double) d[4];
double dbyte=byte b[4];
double dshort=short s[4];
double dint= int i[4];
double dlong=long l[4];
double dfloat= float f[4];
reurn ergebnis;
} ... 23 fehler
ich soll ne methode erstellen, die alle mgl elemntaren datentypen verleicht, also byte mit short udn so was, und darauffolgend, im selben prog, ne mainmethode, die es auch macht...wie masche ich das am besten?? stehe völlig aufm schlauch, ich post mal meine bisheirigen verusche
public class convertTypes{
public static void ergenbis(){
byte[]b=new byte;
byte []b={100,100,100,100,100,100,100,100};
short []s=new short;
short[]s={10000,10000,10000,10000,10000,10000};
int []i=new int{100000,100000,100000,100000,100000,100000,100000,100000};
long []l=new long;
long []l={1000000,1000000,1000000,1000000,1000000,1000000,10000000};
float []f=new float;
float []f={5.121212f,5.121212f,5.121212f,5.121212f,5.121212f,5.121212f};
double []d=new double;
double[] d={100.1001,100.1001,100.1001,100.1001,100.1001,100.1001,100.1001};
byte bshort=(short) s[0];
byte bint=(int) i[0];
byte blong= (long) l[0];
byte bfloat= (float) f[0];
byte bdouble=(double) d[0];
short sbyte=byte b[0];
short sint=(int) i[1];
short slong=(long) s[1];
short sfloat=(float) f[1];
short fdouble=(double) d[1];
int ibyte=byte b[1];
int ishort=short s[1];
int ilong=(long) l[2];
int ifloat=(float) f[2];
int idouble=(double) d[2];
long lbyte=byte b[2];
long lshort=short s[2];
long lint=int i[2];
long lfloat= (float) f[3];
long ldouble=(double) d[3];
float fbyte=byte b[3];
float fshort=short s[3];
float fint=int i[3];
float flong=long l[3];
float fdouble=(double) d[4];
double dbyte=byte b[4];
double dshort=short s[4];
double dint= int i[4];
double dlong=long l[4];
double dfloat= float f[4];
reurn ergebnis;
} ... 23 fehler