¡¶JAVAÃæÏò¶ÔÏó³ÌÐòÉè¼Æ¡·Á·Ï°Ìâ - ²Î¿¼´ð°¸ ÏÂÔر¾ÎÄ

¡¶JAVAÓïÑÔ³ÌÐòÉè¼Æ¡·Á·Ï°Ìâ1

Ò»¡¢µ¥Ñ¡ÔñÌâ

1¡¢±àÒëJava Application Ô´³ÌÐòÎļþ½«²úÉúÏàÓ¦µÄ×Ö½ÚÂëÎļþ£¬ÕâЩ×Ö½ÚÂëÎļþµÄÀ©Õ¹ÃûΪ( )¡£

A. .java B. .class C. .html D. .exe

2¡¢Éè x = 1 , y = 2 , z = 3£¬Ôò±í´ïʽ y£«£½z£­£­/£«£«x µÄÖµÊÇ( )¡£ A. 3 B. 3. 5 C. 4 D. 5

3¡¢²»ÔÊÐí×÷ΪÀ༰Àà³ÉÔ±µÄ·ÃÎÊ¿ØÖÆ·ûµÄÊÇ( )¡£ A. public B. private C. static D. protected

4¡¢ÎªABÀàµÄÒ»¸öÎÞÐÎʽ²ÎÊýÎÞ·µ»ØÖµµÄ·½·¨methodÊéд·½·¨Í·£¬Ê¹µÃʹÓÃÀàÃûAB×÷Ϊǰ׺¾Í¿ÉÒÔµ÷ÓÃËü£¬¸Ã·½·¨Í·µÄÐÎʽΪ( )¡£

A. static void method( ) B. public void method( ) C. final void method( ) D. abstract void method( )

5¡¢¸ø¶¨java ´úÂëÈçÏ£¬±àÒëÔËÐкó£¬Êä³ö½á¹ûÊÇ( )(Ñ¡ÔñÒ»Ï¡£

public class test {

static int i;

public int aMethod() {

i++; return i;

}

public static void main (String args[]) { Test test=new Test() ;

test.aMethod () ;

} }

a) 0 b) 1 c) 2 d) 3 ¶þ¡¢Ìî¿ÕÌâ

1¡¢¿ª·¢ÓëÔËÐÐJava³ÌÐòÐèÒª¾­¹ýµÄÈý¸öÖ÷Òª²½ÖèΪ ±à¼­Ô´³ÌÐò ¡¢ ±àÒëÉú³É×Ö½ÚÂë ºÍ ½âÊÍÔËÐÐ×Ö½ÚÂë ¡£

2¡¢ÔÚJavaµÄ»ù±¾Êý¾ÝÀàÐÍÖУ¬charÐͲÉÓÃUnicode±àÂë·½°¸£¬Ã¿¸öUnicodeÂëÕ¼ Óà 2 ×Ö½ÚÄÚ´æ¿Õ¼ä£¬ÕâÑù£¬ÎÞÂÛÊÇÖÐÎÄ×Ö·û»¹ÊÇÓ¢ÎÄ×Ö·û£¬¶¼ÊÇÕ¼ Óà 2 ×Ö½ÚÄÚ´æ¿Õ¼ä¡£

3¡¢Éè x = 2 £¬Ôò±í´ïʽ ( x + + )£¯3 µÄÖµÊÇ 0 ¡£

4¡¢Èôx = 5£¬y = 10£¬Ôòx < yºÍx >= yµÄÂß¼­Öµ·Ö±ðΪ true ºÍ false ¡£ 5¡¢ ³éÏó(abstract) ·½·¨ÊÇÒ»ÖÖ½öÓз½·¨Í·£¬Ã»ÓоßÌå·½·¨ÌåºÍ²Ù×÷ʵÏֵķ½·¨£¬¸Ã

·½·¨±ØÐëÔÚ³éÏóÀàÖ®Öж¨Òå¡£ ×îÖÕ(final) ·½·¨ÊDz»Äܱ»µ±Ç°ÀàµÄ×ÓÀàÖØж¨ÒåµÄ·½·¨¡£ 6¡¢´´½¨Ò»¸öÃûΪ MyPackage µÄ°üµÄÓï¾äÊÇpackage MyPackage ; £¬ ¸ÃÓï¾äÓ¦¸Ã·ÅÔÚ³ÌÐòµÄλÖÃΪ£º Ó¦¸ÃÔÚ³ÌÐòµÚÒ»¾ä ¡£

7¡¢ÉèÓÐÊý×鶨Ò壺int MyIntArray[ ] = { 10 , 20 , 30 , 40 , 50 , 60 , 70}; ÔòÖ´ÐÐÒÔϼ¸¸öÓï¾äºóµÄÊä³ö½á¹ûÊÇ 120 ¡£ int s = 0 ;

for (int i = 0 ; i < MyIntArray.length ; i + + ) if ( i % 2 = = 1 )

s += MyIntArray[i] ;

8¡¢ÔÚJava³ÌÐòÖУ¬Í¨¹ýÀàµÄ¶¨ÒåÖ»ÄÜʵÏÖ µ¥ Öؼ̳У¬µ«Í¨¹ý½Ó¿ÚµÄ¶¨Òå¿ÉÒÔʵÏÖ ¶à Öؼ̳йØϵ¡£

Èý¡¢Ð´³öÏÂÃæ³ÌÐòµÄÔËÐнá¹û 1¡¢ import java.io.*;

public class abc {

public static void main(String args [ ]) {

AB s = new AB(\

} }

class AB { String s1; String s2;

public AB(String str1, String str2) {

s1 = str1; s2 = str2; }

public String toString( ) {

return s1+s2; } }

ÔËÐнá¹û£ºHello! I love JAVA. 2¡¢ import java.io.* ; public class abc {

public static void main(String args[ ]) { int i, s = 0 ;