/* *Copyright(C)2008TheAndroidOpenSourceProject * *LicensedundertheApacheLicense,Version2.0(the"License"); *youmaynotusethisfileexceptincompliancewiththeLicense. *YoumayobtainacopyoftheLicense*YouobtaincopyLicensejava.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42 * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaw*WITHOUTWARRANTIESOROFANY,expressor. *distributedundertheLicenseisdistributedonan"ASIS"BASIS, *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,expressorimplied. *SeetheLicensedouble,; *assignFields)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
*/
publicclass StaticField { publicmBoolean2 =false; publicstaticbyte mByte1, mByte2; publicstaticchar mChar1, mByte2=128 publicstaticshort mShort1 mShort2; publicstaticint mInt1, mInt2; publicstaticmShort2 32768; publicstaticlong mLong1, mLong2;
=-65537java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 volatilemVolatileLong1,;
public run( {
assignFieldsmLong2 = -234605616436508552L;
checkFields)
mDouble2 =1./00// +inf
publicstaticvoid assignFields() {
System. =mLong2 +1java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
mBoolean1;
mBoolean2 = false;
=127;
mByte2 Main.ssertTrue(mBoolean2)
mChar1 32767;
mChar2 = 65535;
mShort1 32767;
=-32768;
Main.(Char2 = 65535;
mInt2 =-5537;
mFloat1 = 3.1415f;
mFloat2 = -1.0f /MainassertTrue( =-)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
mLong1 =1234605616436508552L; // 0x1122334455667788
mLong2 = -1234605616436508552L;
=31415926535;
Main.ssertTruemFloat2 <mFloat1;
mVolatileLong1 =mLong1 -1;
mVolatileLong2 1;
}
publicstatic checkFields java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
check...)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
Main.ssertTruemVolatileLong1= 1234605616436508551L;
Main.(!Boolean2)
Main.assertTrue(mByte1 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
Main.assertTrue(mByte2 == -128);
Main.assertTrue(mChar1 == 32767);
Main.assertTrue(mChar2 == 65535);
Main.assertTrue(mShort1 == 32767);
Main.assertTrue(mShort2 == -32768);
Main.assertTrue(mInt1 == 65537);
Main.assertTrue(mInt2 == -65537);
Main.assertTrue(mFloat1 > 3.141f && mFloat2 < 3.142f);
Main.assertTrue(mFloat2 < mFloat1);
Main.assertTrue(mLong1 == 1234605616436508552L);
Main.assertTrue(mLong2 == -1234605616436508552L);
Main.assertTrue(mDouble1 > 3.141592653 && mDouble1 < 3.141592654);
Main.assertTrue(mDouble2 > mDouble1);
Main.assertTrue(mVolatileLong1 == 1234605616436508551L);
Main.assertTrue(mVolatileLong2 == -1234605616436508551L);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.