¡¶java³ÌÐòÉè¼Æ¡·¸´Ï°×ÊÁÏ ÏÂÔر¾ÎÄ

ÄÚÈÝ·¢²¼¸üÐÂʱ¼ä : 2025/1/9 6:28:51ÐÇÆÚÒ» ÏÂÃæÊÇÎÄÕµÄÈ«²¿ÄÚÈÝÇëÈÏÕæÔĶÁ¡£

JAVA³ÌÐòÉè¼Æ¸´Ï°×ÊÁÏ

¡¶Java³ÌÐòÉè¼Æ¡·

Ñ¡ÔñÌâ

´ðÌâÒªÇ󣺵¥Ñ¡Ì⣬ÿÌâÖ»ÓÐÒ»¸öÕýÈ·´ð°¸£¬Ñ¡ÔñÕýÈ·¸ø·Ö£¬²»ÕýÈ·²»¸ø·Ö¡£

1¡¢ ÏÂÃ棨 A £©Êý¾ÝÀàÐÍ¿ÉÓÃÓÚmain()·½·¨Öд«µÝµÄ²ÎÊý

A¡¢String B¡¢Integer C¡¢Boolean D¡¢Variant

2¡¢ÒÔϵÄÑ¡ÏîÖÐÄÜÕýÈ·±íʾJavaÓïÑÔÖеÄÒ»¸öÕûÐͳ£Á¿µÄÊÇ£¨ B £©A¡¢12£® B¡¢-20 C¡¢1,000 D¡¢4 5 6 3¡¢ÏÂÁеıäÁ¿¶¨ÒåÖÐ,ÕýÈ·µÄÊÇ£¨ D £©

A¡¢boolean b1=\ B¡¢float x=6.6; C¡¢byte i=200; D¡¢double y;

4¡¢ÔÚÆÁÄ»ÉÏÏÔʾµÄÏûÏ¢ÕýÈ·µÄÓï¾äÊÇ£¨ A £©

A¡¢System.out.println(\ B¡¢system.out.println(\ C¡¢System.Out.Println(\ D¡¢System.out.println('I am Java Expert');

5¡¢ÏÂÃ棨 B £©ÃüÁî¿ÉÓÃÓÚ±àÒëJava³ÌÐò

A¡¢java B¡¢javac C¡¢appletviewer D¡¢javadoc 6¡¢Java±àÒëÆ÷»á½«Java³ÌÐòת»»Îª£¨ A £©

A¡¢×Ö½ÚÂë B¡¢¿ÉÖ´ÐдúÂë

C¡¢»úÆ÷´úÂë D¡¢ÒÔÉÏËùÓÐÑ¡Ï²»ÕýÈ· 7¡¢ÒÔÏÂ×Ö·û³£Á¿Öв»ºÏ·¨µÄÊÇ£¨ C £©

A¡¢'@' B¡¢'&' C¡¢\ D¡¢'Õû'

8¡¢ÒÔϵÄÑ¡ÏîÖÐÄÜÕýÈ·±íʾJavaÓïÑÔÖеÄÒ»¸ödoubleÐͳ£Á¿µÄÊÇ£¨ C A¡¢Float.MIN_VALUE B¡¢1.8e-6F C¡¢2.0 D¡¢'abc'

9¡¢ÒÔϵıäÁ¿¶¨ÒåÓï¾äÖÐ,ºÏ·¨µÄÊÇ£¨ C £©¡£

A¡¢float $_*5= 3.4F; B¡¢byte b1= 15678; C¡¢int $abc=5; D¡¢int class=5;

10¡¢ÔÚÒ»¸öÀàÖж¨ÒåµÄ³ÉÔ±±äÁ¿ºÍ³ÉÔ±·½·¨Ê±£¬²»ÔÊÐí£¨ A £©¡£

A. Á½¸ö³ÉÔ±±äÁ¿ÃûÏàͬ.

B. ³ÉÔ±±äÁ¿Óë³ÉÔ±·½·¨ÃûÏàͬ. C. Á½¸ö³ÉÔ±·½·¨ÃûÏàͬ

D. ³ÉÔ±·½·¨ÖеIJÎÊýÓë³ÉÔ±±äÁ¿ÃûÏàͬ 11¡¢ÏÂÁÐÐðÊöÕýÈ·µÄÊÇ £¨ B £©

A. ÔÚÀàÖеĹ¹Ôì·½·¨µÄÃû×ÖÓëÀàµÄÃû×ÖÏàͬ,¶øÇÒ²»ÄÜÖØÔØ B. ÔÚÀàÖеĹ¹Ôì·½·¨µÄÃû×ÖÓëÀàµÄÃû×ÖÏàͬ,µ«Ã»Óзµ»ØÀàÐÍ. C. ÔÚÀàÖеĹ¹Ôì·½·¨µÄÃû×ÖÓëÀàµÄÃû×ÖÏàͬ,¶øÇÒÓзµ»ØÀàÐÍ. D. ÔÚÀàÖеĹ¹Ôì·½·¨µÄÃû×ÖÓëÀàµÄÃû×ÖÏàͬ,¶øÇÒ²»Äܳõʼ»¯.

µÚ 2 Ò³

£©¡¶Java³ÌÐòÉè¼Æ¡·

12¡¢Java applicationÖеÄÖ÷ÀàÐè°üº¬main·½·¨£¬main·½·¨µÄ·µ»ØÀàÐÍÊÇʲô£¿£¨ D £©

A¡¢int B¡¢float C¡¢double D¡¢void 13¡¢¸ø³öÈçÏ´úÂë: class Test{ private int m; public static void fun() { // some code... (Test.m) } }

ÈçºÎʹ³ÉÔ±±äÁ¿m ±»º¯Êýfun()Ö±½Ó·ÃÎÊ?£¨ C £©

A¡¢½«private int m ¸ÄΪprotected int m B¡¢½«private int m ¸ÄΪ public int m C¡¢½«private int m ¸ÄΪ static int m D¡¢½«private int m ¸ÄΪ int m

14¡¢ÔÚJavaÖУ¬Ò»¸öÀà¿Éͬʱ¶¨ÒåÐí¶àͬÃûµÄ·½·¨£¬ÕâЩ·½·¨µÄÐÎʽ²ÎÊý¸öÊý¡¢ÀàÐÍ»ò˳Ðò¸÷²»Ïàͬ£¬´«»ØµÄÖµÒ²¿ÉÒÔ²»Ïàͬ¡£ÕâÖÖÃæÏò¶ÔÏó³ÌÐòµÄÌØÐÔ³ÆΪ£¨ C £©¡£

A¡¢Òþ²Ø B¡¢¸²¸Ç C¡¢ÖØÔØ D¡¢Java²»Ö§³Ö´ËÌØÐÔ 15¡¢Ö´ÐÐÏÂÃæµÄ³ÌÐò£¬Êä³ö½á¹ûÊÇ£¨ B £©¡£ public class Test { int x= 12;

public void method(int x) { x+=x;

System.out.println(x); }

public static void main(String[] args){ Test t = new Test(); t.method(5); }}

A. 5 B. 10 C. 12 D. 17 E. 24

16¡¢ÈôÔÚijһ¸öÀඨÒåÖж¨ÒåÓÐÈçϵķ½·¨£º final void aFinalFunction( ); Ôò¸Ã·½·¨ÊôÓÚ£¨ C £©¡£ ¡£

A. ±¾µØ·½·¨. B. ½â̬·½·¨. C. ×îÖÕ·½·¨ D. ³éÏó·½·¨ abstract 17¡¢ÏÂÁÐÐðÊöÕýÈ·µÄÊÇ £¨ D £©

A. ×ÓÀà¿ÉÒԼ̳и¸ÀàµÄËùÓгÉÔ±¡£

B.. ³ýÁ˼̳и¸ÀàµÄ³ÉÔ±ÒÔÍ⣬×ÓÀ಻¿ÉÒÔ´´½¨×Ô¼ºµÄ³ÉÔ±¡£ C. µ±ÊµÀý»¯×ÓÀàʱ£¬¸¸ÀàµÄ¹¹Ôì·½·¨²»±»µ÷ÓᣠD. ×ÓÀàÖ»Äܼ̳и¸ÀàµÄ·Ç˽ÓгÉÔ±¡£ private

18¡¢Ä³java³ÌÐòµÄÀඨÒåÈçÏÂ: public class MyClass extends BaseClass{ } Ôò¸ÃjavaÔ´ÎļþÔÚ´æÅÌʱµÄÔ´ÎļþÃûӦΪÈçÏÂÄÄÒ»ÖÖ:( D )

A. myclass.java B. Myclass.java C. MYCLASS.java D. MyClass.java 19¡¢¸ø³öÈçÏ´úÂë: class A{ public A(){

µÚ 3 Ò³

¡¶Java³ÌÐòÉè¼Æ¡·

System.out.print(\¹¹Ôì·½·¨) } }

public class B extends A{ public B(){ System.out.print(\£¨¹¹Ôì·½·¨£© } public static void main(String[ ] args){ new B( ); } }

³ÌÐòµÄÊä³ö½á¹û£¨ A £©

A¡¢AB B¡¢A C¡¢B D¡¢BA

20¡¢ÒÔÏÂÄĸö½Ó¿ÚµÄ¶¨ÒåÊÇÕýÈ·µÄ£¿£¨ D £©¡£

A¡¢ interface A

{ void print() { } ;} B¡¢ abstract interface A { void print() ;}

C¡¢ abstract interface A extends I1, I2 //I1¡¢I2ΪÒѶ¨ÒåµÄ½Ó¿Ú { abstract void print(){ };} D¡¢ interface A

{ void print();} (³éÏó·½·¨)

21¡¢ÏÂÃæÑ¡ÏîÖÐÄÜ°Ñ×Ö·û´®×ª»»³ÉfloatÀàÐ͵ÄÊÇ£¿£¨ B £©

A. float value = new Float(str);

B. float value = Float.parseFloat(str)£»int a=5;Integer.parseInt() Double.parseDouble() Float.parseFloat C. float value = Float.floatValue(str);

D. float value = (new Float()).parseFloat(str)

22¡¢ÔÚij¸öÀàÖдæÔÚÒ»¸ö·½·¨£ºvoid getSort(int x),ÒÔÏÂÄÜ×÷ΪÕâ¸ö·½·¨µÄÖØÔصÄÉùÃ÷µÄÊÇ( C )

A. public get (float x) B. int getSort(int y)

C. double getSort(int x,int y) D. void get(int x,int y)

23¡¢Ï±߳ÌÐòÔËÐеÄÊä³ö½á¹ûÊÇ£¨ B £©

class Base£û Base(){System.out.print(\}

public class Alpha extends Base { public static void main(String[] args){ new Alpha(); new Base(); } £ý

A¡¢Base B¡¢BaseBase C¡¢³ÌÐò±àÒëʧ°Ü D¡¢³ÌÐòÔËÐе«Ã»ÓÐÈκÎÊä³ö

µÚ 4 Ò³

¡¶Java³ÌÐòÉè¼Æ¡·

24¡¢ÏÂÁÐ˵·¨ÕýÈ·µÄÊÇ£¨ C £©¡£

A. Ò»¸ö×ÓÀà¿ÉÒÔÓжà¸ö¸¸À࣬һ¸ö¸¸ÀàÒ²¿ÉÒÔÓжà¸ö×ÓÀà B. Ò»¸ö×ÓÀà¿ÉÒÔÓжà¸ö¸¸À࣬µ«Ò»¸ö¸¸ÀàÖ»¿ÉÒÔÓÐÒ»¸ö×ÓÀà C. Ò»¸ö×ÓÀà¿ÉÒÔÓÐÒ»¸ö¸¸À࣬µ«Ò»¸ö¸¸Àà¿ÉÒÔÓжà¸ö×ÓÀà D. ÉÏÊö˵·¨¶¼²»¶Ô 25¡¢¹ØÓÚÏÂÃæ³ÌÐòƬ¶Î£¬£¨ B £©µÄ½áÂÛÊÇÕýÈ·µÄ¡£ a == b s1.equals(s2)

String a = \ String b = \ String s1 = new String(¡±Java¡±); String x = \ String y = \ String s2 = new String(¡±Java¡±); String c = x + y;

A¡¢aºÍbÖ¸Ïòͬһ¸öʵÀý¶ÔÏó£¬aºÍcÖ¸Ïòͬһ¸öʵÀý¶ÔÏó B¡¢aºÍbÖ¸Ïòͬһ¸öʵÀý¶ÔÏó£¬aºÍc²»Ö¸Ïòͬһ¸öʵÀý¶ÔÏó C¡¢aºÍb²»Ö¸Ïòͬһ¸öʵÀý¶ÔÏó£¬aºÍcÖ¸Ïòͬһ¸öʵÀý¶ÔÏó D¡¢aºÍb²»Ö¸Ïòͬһ¸öʵÀý¶ÔÏó£¬aºÍc²»Ö¸Ïòͬһ¸öʵÀý¶ÔÏó 26¡¢ÏÂÃæÕâ¶Î´úÂë»á²úÉú£¨ C £©¸öString¶ÔÏó¡£

String s1 = \ String s2 = s1.substring(2, 3);

String s3 = s1.toString(); String s4 = new StringBuffer(s1).toString(); A¡¢1 B¡¢2 C¡¢3 D¡¢4

27¡¢ÉèÓж¨Ò壺String s=¡±World¡±;£¬ÏÂÁÐÓï¾ä´íÎóµÄÊÇ£¨ D £©¡£

A¡¢int m=s.indexOf(?r?); B¡¢char c=s.charAt(0); C¡¢int n=s.length(); D¡¢String str=s.append(); 28¡¢ÒÑÖªint i = 2147483647; ++i; ÔòiµÄÖµµÈÓÚ£¨ A £©¡£ Byte 128~127 127+1

A¡¢-2147483648 B¡¢2147483647 C¡¢2147483648 D¡¢-1 29¡¢Èôx = 5,y = 8£¬Ôò±í´ïʽx|yµÄֵΪ£¨ B £©¡£

A¡¢3 B¡¢13 C¡¢0 D¡¢5

30¡¢Ö´ÐÐString[ ] s=new String[10];Óï¾äºó£¬Äĸö½áÂÛÊÇÕýÈ·µÄ£¿£¨ B £©

A¡¢s[0] Ϊ δ¶¨Òå B¡¢s.length Ϊ10 C¡¢s.length Ϊ11 D¡¢s[10] Ϊ \31¡¢ÏÂÁÐ˵·¨²»ÕýÈ·µÄÊÇ£¨ D £©¡£

A¡¢±í´ïʽ¡°1+2>3¡±µÄÖµÊÇfalse B¡¢±í´ïʽ¡°1+2||3¡±ÊÇ·Ç·¨µÄ±í´ïʽ C¡¢±í´ïʽ¡°i+j=1¡±ÊÇ·Ç·¨µÄ±í´ïʽ D¡¢±í´ïʽ¡°1+2>3¡±µÄÖµÊÇtrue

32¡¢ÈôString s = \ String t = \ char c[] = {'h','e','l','l','o'} ; ÔòÏÂÁÐÄĸö±í´ïʽ·µ»Øfalse£¿£¨ C £©

A¡¢s.equals(t); B¡¢t.equals(new String(\ C¡¢t.equals(c); D¡¢s==t; 33¡¢Ö´ÐÐÍêÏÂÃæ³ÌÐòƬ¶Îºó£¬£¨ B £©µÄ½áÂÛÊÇÕýÈ·µÄ¡£ int a, b, c; a = 1; b = 2; c = (a + b > 3 ? a++ : b++);

A¡¢aµÄÖµÊÇ2£¬bµÄÖµÊÇ3 B¡¢aµÄÖµÊÇ1£¬bµÄÖµÊÇ3 C¡¢aµÄÖµÊÇ1£¬bµÄÖµÊÇ2 D¡¢cµÄÖµÊÇfalse 34¡¢ÏÂÃæ³ÌÐòƬ¶ÎÊä³öµÄÊÇ£¨ D £©¡£

int i = 0, j = 9; do {

if(i++ > --j) break; } while(i < 4);

System.out.println(\

A¡¢i = 4 and j = 4 B¡¢i = 5 and j = 5 C¡¢i = 5 and j = 4 D¡¢i = 4 and j = 5 35¡¢ÉèÓж¨Òå¡°int k=3;¡±£¬Óï·¨ÕýÈ·ÇÒֵΪtrueµÄ±í´ïʽÊÇ£¨ D £©¡£

µÚ 5 Ò³