java面向对象习题

2026/1/19 23:19:41

public class NewSuper extends SuperEx { public NewSuper(String a,String b) { super(a,b); } public static void main(String args []) { SuperEx a = new SuperEx(\ SuperEx b = new NewSuper(\ a.aMethod(); b.aMethod(); } public void aMethod() { System.out.println(\ } } 1) The following is displayed: r:Hi s:Hi 2) Compiler error at the line \ 3) The following is displayed: r:Hi r:Hi s:Bart 4) The following is displayed r:Hi s:Tom r:Hi s:Bart String s= \s.concat(\s.replace('C','F'); System.out.println(s); What will be printed out? A. Compilation Error says that String is immutable B. ABFDE C. ABCDE D. ABCD class A { public int getNumber(int a) { return a + 1; } } class B extends A { public int getNumber (int a) { return a + 2 } public static void main (String args[]) { A a = new B(); System.out.printIn(a.getNumber(0)); }} What is the result? A. Compilation succeeds and 1 is printed. B. Compilation succeeds and 2 is printed. C. An error at line 8 causes compilation to fail. D. An error at line 13 causes compilation to fail. E. An error at line 14 causes compilation to fail. 编写简单工厂模式

... ... ...

编写类似DAO模式的程序

练习编写二叉树, 使用前,中,后序遍历树。

写一个计算器的接口

从键盘输入字符串,回车后反转打印

假设字符串类似这样的aba和aab就相等,现在随便给你二组字符串,请编程比较他们看是否相等

从键盘输入字符串,回车后按单词反转 Where there is a way Way a is there where

从键盘读入几个数,打印最小的那个

编程显示某一文件目录下的文件名

给你一组字符串如:iu7i8hy4jnb2,让你编程输出里面的数字:7842

写一个代码片断统计一个字符串中出现的字符及其个数,例如对于字符串“abcaaabcd”,统计的结果是: a(4个)b(2个)c(2个)d(1个)

匹配英文字母组成的字符串(不区分大小写): 匹配ip地址:

匹配数字个数限制(此为6个数字)

IO

编程文件Copy程序

一个文本文件中约有10万多行的数据,每个数据占一行(数据为一个整数)。要求:统计出总行数,并找出出现次数最多的那个整数。


java面向对象习题.doc 将本文的Word文档下载到电脑
搜索更多关于: java面向对象习题 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219