【正文】
tring, or 1 if there is no such occurrence.public int lastIndexOf(String str)Returns the index within this string of the last occurrence of the specified substring. The last occurrence of the empty string is considered to occur at the index value (). Examples: abca.lastIndexOf(a) return 3Parameters:str the substring to search for.Returns:the index of the last occurrence of the specified substring, or 1 if there is no such occurrence.public String substring(int beginIndex)Returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string. Examples: Harbison.substring(3) returns bisonemptiness.substring(9) returns (an empty string) Parameters:beginIndex the beginning index, inclusive.Returns:the specified substring.public String substring(int beginIndex, int endIndex)Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex 1. Thus the length of the substring is endIndexbeginIndex. Examples: hamburger.substring(4, 8) returns urge smiles.substring(1, 5) returns mile Parameters:beginIndex the beginning index, inclusive.endIndex the ending index, exclusive.Returns:the specified substring.得分閱卷人五、設(shè)計(jì)并編程(共8分)3仔細(xì)閱讀給定的代碼和程序運(yùn)行結(jié)果,完方法size()、del()代碼編寫。 lastNode = 。 String sa2[] = ()。 } public String getExtendName(){(1分) return ((.)+1)。注:考核類型是指:三基類、一般綜合型和綜合型。 return。 } (sum/count)。 (s001)。 } String[] dest = new String[count]。 (文件全名(帶擴(kuò)展名):+())。 ListStudent stuList=()。 } }public class T30 { /*取得數(shù)據(jù)庫連接*/ Connection getConnection(){ ……//此處省略n行 } /* 查詢數(shù)據(jù)庫中所有學(xué)生的數(shù)據(jù),將一條學(xué)生信息記錄轉(zhuǎn)化成一個(gè)Studetn對(duì)象, * 多個(gè)記錄生成多個(gè)Student,將生成的對(duì)象放入到List中,一起返回到 */ ListStudent queryAllStudent(){ ListStudent stuList= (30) 。 //奇數(shù)計(jì)數(shù) for(int n:number){ if( (29) ){//如果n是奇數(shù),奇數(shù)計(jì)數(shù)加1 odd++。 ()。 }}class B extends P{ void goo() { (B)。t=add(t)){ (D)。(D)P p=new P(){void foo(){}}。(A)a[0][1]=200 (B)a[0].length (C)a[1][1]=100 (D)7. 以下數(shù)據(jù)類型存儲(chǔ)空間最大的是( )。int a[]={1,2,3}。abstract class P{}class A extends P{}abstract class B extends P{}(A)P p=new A()。 return ++i。}class A extends P{ A(){ super()。 } public void t2(int i) { (E)。 } return (27) 。 = name。 } catch (SQLException e) {} } return stuList。 } ////////////////////////////////////////////////////////////////////////////////