首页 java面试题及答案

java面试题及答案

举报
开通vip

java面试题及答案java面试题及答案 java基础 1. 用代码示例一个多态的例子 2. java的基本数据类型包括哪些,String是基本的数据类型吗 ? 3. int 和 Integer 有什么区别 4. String 和StringBuffer的区别 5. Collection 和 Collections的区别。 6. &和&&的区别。 7. Overload和Override的区别,试用java代码举例。 8. error和exception有什么区别? 9. abstract class和interfa...

java面试题及答案
java面试 快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题 及答案 java基础 1. 用代码示例一个多态的例子 2. java的基本数据类型包括哪些,String是基本的数据类型吗 ? 3. int 和 Integer 有什么区别 4. String 和StringBuffer的区别 5. Collection 和 Collections的区别。 6. &和&&的区别。 7. Overload和Override的区别,试用java代码举例。 8. error和exception有什么区别? 9. abstract class和interface有什么区别? 10. final, finally, finalize的区别,试用java代码示例。 11. 什么时候用assert。 试给出例子 12. forward 和redirect的区别 13. GC是什么? 为什么要有GC? 14. short s1 = 1; s1 = s1 + 1;有什么错? short s1 = 1; s1 += 1;有什么错? 15. Math.round(11.5)等於多少? Math.round(-11.5)等於多少? 16. String s = new String("xyz");创建了几个String Object? 17. 设计4个线程,其中两个线程每次对j增加1,另外两个线程对j每次减少1。写出程序。 18. Java有没有goto? 19. 启动一个线程是用run()还是start()? 20. 应用服务器有那些,列出你所知道的例子, 21. 接口是否可继承接口? 抽象类是否可实现(implements)接口? 抽象类是否可继承实体类 22. Set里的元素是不能重复的,那么用什么 方法 快递客服问题件处理详细方法山木方法pdf计算方法pdf华与华方法下载八字理论方法下载 来区分重复与否呢? 是用==还是equals()? 23. 它们有何区别? 24. 构造器Constructor是否可被override? 25. 是否可以继承String类? 26. swtich是否能作用在byte上,是否能作用在long上,是否能作用在String上? 27. try {}里有一个return语句,那么紧跟在这个try后的finally {}里的code会不会 28. 编程题: 用最有效率的方法算出2乘以8等於几? 29. 当一个对象被当作参数传递到一个方法后,此方法可改变这个对象的属性,并可返回变 化后的结果,那么这里到底是值传递还是引用传递? 30. 当一个线程进入一个对象的一个synchronized方法后,其它线程是否可进入此对象的其 它方法? 31. 编程题: 写一个Singleton的示例。 32. 数组有没有length()这个方法? String有没有length()这个方法, 33、排除错误 interface Playable { void play(); } interface Bounceable { void play(); } r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. interface Rollable extends Playable, Bounceable { Ball ball = new Ball("PingPang"); } class Ball implements Rollable { //… } SQL部分 1.一个表中的Id有多个 记录 混凝土 养护记录下载土方回填监理旁站记录免费下载集备记录下载集备记录下载集备记录下载 ,把所有这个id的记录查出来,并显示共有多少条记录数。 ------------------------------------------ Student表有三列,分别是姓名、课程、成绩 Name Curricula Mark 张三 语文 70 李四 数学 80 王朝 英语 59 城南 马哲 70 王朝 语文 90 . . . . . . 2.查询每门学科成绩及格(Mark > 60)的学生的名字, 指定学科查询: select Name from Student where Curricula ='指定学科' and mark >60 不指定学科,按照学科排序 3.查询出总分排名前三的学员名字? 总分排名前三的学员名字: r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. 答案: 1. 用代码示例一个多态的例子 子类Wind和Brass重写了父类Instrument中的play方法,是多态的一种表现。 package javaBasic; class Instrument{ public Instrument(){ System.out.println("default constructor Instrument()"); } public void play(){ System.out.println("Play instrument()"); } } class Wind extends Instrument{ public Wind(){ System.out.println("default constructor Wind()"); } public void play(int i){ System.out.println("Play Wind() " +i); } } class Brass extends Instrument{ public Brass(){ System.out.println("default constructor Brass()"); } public void play(String s){ System.out.println("Play Brass() " +s); } } public class e1 { public static void main(String[] args) { // TODO Auto-generated method stub Instrument i1=new Wind(); Instrument i2=new Brass(); i1.play(); i2.play(); new Wind().play(); r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. new Wind().play(25); new Brass().play(); new Brass().play("Hello world"); } } 2. java的基本数据类型包括哪些,String是基本的数据类型吗 ? java的基本数据类型包括:布尔型boolean,整型,字符型char和浮点型, 其中整型包括:字节型byte,短整型short,整型int,长整型long 其中浮点型包括:单精度float,双精度double String不是基本数据类型,是java中的类,是对象数据类型 3. int 和 Integer 有什么区别 int是基本数据类型,而Integer是int的包装类,它里面定义了很多转换方法。 4. String 和StringBuffer的区别 String是用于处理不可变的字符串,而String是处理可变字符串的。不可变字符串一旦创建,其 内容 财务内部控制制度的内容财务内部控制制度的内容人员招聘与配置的内容项目成本控制的内容消防安全演练内容 就不可以改变,既不能插入新字符也不能改变字符串长度,而可变字符串则可以进行此类操作。 5. Collection 和 Collections的区别。 Collections是个java.util下的类,此类完全由在 collection 上进行操作或返回 collection 的静态方法组成。 Collection是个java.util下的接口,它是各种集合结构的父接口。 6. &和&&的区别。 &是按位与运算符,它是用于整数的二进制位的与操作,&&是逻辑与运算符,用于进行两个或多个表达式的与操作 7. Overload和Override的区别,试用java代码举例。 Overload是方法的重载,它是一个类中的多态性的表现,Override是重写,是父类与子类多态性的一种表现。 子类Wind和Brass重写(Overlride)了父类Instrument中的play方法, package javaBasic; class Instrument{ public Instrument(){ System.out.println("default constructor Instrument()"); } public void play(){ System.out.println("Play instrument()"); } r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. } class Wind extends Instrument{ public Wind(){ System.out.println("default constructor Wind()"); } public void play(int i){ System.out.println("Play Wind() " +i); } } class Brass extends Instrument{ public Brass(){ System.out.println("default constructor Brass()"); } public void play(String s){ System.out.println("Play Brass() " +s); } } public class e1 { public static void main(String[] args) { // TODO Auto-generated method stub Instrument i1=new Wind(); Instrument i2=new Brass(); i1.play(); i2.play(); new Wind().play(); new Wind().play(25); new Brass().play(); new Brass().play("Hello world"); } } ? Instrument中重载(Overload)了play方法 package javaBasic; public class e7_OverrideTest { class Instrument{ public Instrument(){ System.out.println("default constructor Instrument()"); r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. } public void play(){ System.out.println("Play instrument()"); } public void play(int i){ System.out.println("Play instrument() " +i); } public void play(String s){ System.out.println("Play instrument() " +s); } } public static void main(String[] args) { // TODO Auto-generated method stub Instrument in=new e7_OverrideTest().new Instrument(); in.play(); in.play(48); in.play("Override!"); } } 8. error和exception有什么区别? exception是异常,异常是在一个程序执行过程中出现的一个事件,它中断了正常指令的运行,只要使用异常处理 机制 综治信访维稳工作机制反恐怖工作机制企业员工晋升机制公司员工晋升机制员工晋升机制图 做相应的处理,程序还是能跳过异常继续执行的。而error是错误,它是偏离了可接受的代码行为的一个动作或一个实例,是Throwable的一个子集,它指的是一个合理的应用程序不能截获的严重的问题。大多数都是反常的情况。 9. abstract class和interface有什么区别? abstract class是抽象类,抽象类不允许直接用来创建对象,它的作用是为一些相关的类提供公共基类和为下层相关子类提供一些公用方法的实现代码,减少代码冗余。 Interface接口可以看做一种特殊的抽象类,它定义的仅是实现某种特定功能的一组对外接口和规范,而这个功能的真正实现是在在继承这个接口的各类中完成的。接口可以创建对象。 10. final, finally, finalize的区别,试用java代码示例。 final用于声明属性,方法,类,表示属性不可变,方法不可覆盖,类不可继承等;finally在异常处理是出现,表示代码总是执行;finalize是一种方法,在垃圾收集器执行的时候会调用被回收对象的此方法,可以覆盖此方法提供垃圾收集时的其他资源回收。 package javaBasic; import java.io.IOException; final class Book{ r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. boolean checkedOut=false; Book(boolean checkOut){ checkedOut=checkOut; System.out.println("new book()"); } public void checkIn(){ checkedOut=false; } protected void finalize(){ if(checkedOut){ System.out.println("error: book should be checkedOut!"); } } } //class Phylics extends Book{ // error: final class Book cannot be inherited. // Phylics(boolean check){ // super(check); // System.out.println("Phylics"); // } //} public class e10_differencesInFinalFinallyFinalize { public static void main(String[] args) throws IOException{ final int i=0; //i=2; //error: final int i can not be assigned Book novel=new Book(true); novel.checkIn(); new Book(true); System.gc(); //system calls the function of finalize(); try{ int j=System.in.read(); //input a int than system calls finally }catch(Exception e){ System.out.print("error"); e.printStackTrace(); } finally{ System.out.println("input test."); } } r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. } 11. 什么时候用assert。 试给出例子 assert是为了支持assertion而增加的一个关键字,assertion用于对一个boolean表达式进行检查一个正确程序必须保证这个boolean表达式的值为true;如果该值为false,说明程序已经处于不正确的状态下,系统将给出警告或退出。一般来说,assertion用于保证程序最基本、关键的正确性。assertion检查通常在开发和测试时开启。为了提高性能,在软件发布后,assertion检查通常是关闭的。 Assert在单元测试里会用到。 12. forward 和redirect的区别 13. GC是什么? 为什么要有GC? GC是垃圾收集器,Java 程序员不用担心内存管理,因为垃圾收集器会自动进行管理,要请求垃圾收集。 14. short s1 = 1; s1 = s1 + 1;有什么错? short s1 = 1; s1 += 1;有什么错? S1是short短整型,1是int整型变量,s1 + 1也是整型变量,要把int转换为short会造成精度流失,需进行强制转换s1 = short(s1 + 1); short s1 = 1; s1 += 1;在编译和运行时不出错。 15. Math.round(11.5)等於多少? Math.round(-11.5)等於多少? Math.round(11.5)等于12 Math.round(-11.5)等于-11 16. String s = new String("xyz");创建了几个String Object? 2个,一个是字符串池中的"xyz"对象,另一个是堆中的String对象 17.设计4个线程,其中两个线程每次对j增加1,另外两个线程对j每次减少1。写出程序。 package javaBasic; public class ThreadTest2 { private int j = 0; public static void main(String args[]) { ThreadTest2 test = new ThreadTest2 (); Add add1 = test.new Add(); Add add2 = test.new Add(); Minus minus1 = test.new Minus(); Minus minus2 = test.new Minus(); Thread thread1 = new Thread(add1); Thread thread2 = new Thread(add2); Thread thread3 = new Thread(minus1); Thread thread4 = new Thread(minus2); r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. thread1.start(); thread2.start(); thread3.start(); thread4.start(); System.exit(0); } class Add implements Runnable { public void run() { // TODO Auto-generated method stub j++; System.out.println(Thread.currentThread().getName()+j); } } class Minus implements Runnable { public void run() { // TODO Auto-generated method stub j--; System.out.println(Thread.currentThread().getName()+j); } } } 18. Java有没有goto? goto是java中的保留字,但现在没有在java中使用。 19. 启动一个线程是用run()还是start() 启动一个线程是用start(),它使线程所代表的虚拟处理机处于可运行状态,这意味着它可以由JVM调度并执行,但这并不意味着线程就会立即运行。 20. 应用服务器有哪些,列出你所知道的例子, Websphere , weblogic , jboss . iis 21. 接口是否可继承接口? 抽象类是否可实现(implements)接口? 抽象类是否可继承实体类 接口可以继承接口。抽象类可以实现接口,抽象类可以继承实体类,不过这个实体类必须有明确的构造函数。 22. Set里的元素是不能重复的,那么用什么方法来区分重复与否呢? 是用==还是equals()? 用iterator()方法,此方法返回此 set 中的元素上进行迭代的迭代器, r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. 23. 它们有何区别? ==,如果是基本数据类型的话是比较两个数值是否相等 如果是对象的话则是比较引用是否相同 而equals则是比较两个对象的内容是否相同 24. 构造器Constructor是否可被override? 构造器不能被继承,所以不能重写overriding,但是可以重载overloading 25. 是否可以继承String类? String类是final类,所以不能被继承。 26. swtich是否能作用在byte上,是否能作用在long上,是否能作用在String上? Switch作用于整数值, byte类型可以自动转换成int型,所以可以使用,但是不能用于long和String。 27. try {}里有一个return语句,那么紧跟在这个try后的finally {}里的code会不会执行, 一定会被执行的,finally里的code会在return之前执行 28. 编程题: 用最有效率的方法算出2乘以8等於几? package javaBasic; public class e28 { public static void main(String[] args) { int i=8; System.out.print(i<<1); } } 29. 当一个对象被当作参数传递到一个方法后,此方法可改变这个对象的属性,并可返回变化后的结果, 是值传递,Java 编程语言只有值传递参数。当一个对象实例作为一个参数被传递到方法中时,参数的值就是对该对象的引用。对象的内容可以在被调用的方法中改变,但对象的引用是永远不会改变的。 30. 当一个线程进入一个对象的一个synchronized方法后,其它线程是否可进入此对象的其它方法? 一个线程在访问一个对象的同步方法时,另一个线程不能同时访问这个同步方法和另外的同步方法,但可以同时访问这个对象的非同步方法。 31. 编程题: 写一个Singleton的示例。 package javaBasic; r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. public class e31_Singleton { private e31_Singleton(){} private static e31_Singleton instance=new e31_Singleton(); public e31_Singleton getInstance(){ return instance; } } 32.数组有没有length()这个方法? String有没有length()这个方法, 数组是一种特殊的对象,没有一个类与之对应,所以数组中的length()只是一个凡是数 组都拥有的属性;String类则拥有length()这个方法。 33. 排除错误 interface Playable { void play(); } interface Bounceable { void play(); } interface Rollable extends Playable, Bounceable { Ball ball = new Ball("PingPang"); } class Ball implements Rollable { //…这里需加入Ball的构造函数和实现接口中的play方法 public Ball(String ball){ System.out.println(ball); } public void play(){ System.out.print("interface.play()"); } } SQL部分 1.一个表中的Id有多个记录,把所有这个id的记录查出来,并显示共有多少条记录数。 ------------------------------------------ select id, Count(*) from tb group by id having count(*)>1 select * from(select count(ID) as count from table group by ID)T where T.count>1 r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. Student表有三列,分别是姓名、课程、成绩 Name Curricula Mark 张三 语文 70 李四 数学 80 王朝 英语 59 城南 马哲 70 王朝 语文 90 . . . . . . 2.查询每门学科成绩及格(Mark > 60)的学生的名字, 指定学科查询: select Name from Student where Curricula ='指定学科' and mark >60 不指定学科,按照学科排序 select Curricula,Name from Student where mark >60 order by Curricula 3.查询出总分排名前三的学员名字? 总分排名前三的学员名字: select top 3 name,sum(mark) from student group by 1 order by 2 r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment. r included in the County, with the right of abode overseas natural persons; (2) expand the scope of borrower type of occupation; (3) to apply for a loan for business borrowers, as well as the business unit controller or major shareholders. 2, the maximum loan amount (1) to cancel "a maximum loan amount of RMB 300,000" requirement; (2) both for personal consumption and business purposes, different methods were used to determine the loan amount. 3, the loan terms (1) the loan terms with borrowers and not more than 60 years of age; (2) lending operation, should be based on the borrower's production cycle and the anticipated income situation, scientifically and rationally determine the loan period. (E) loans: the three rejected. (F) receive and investigate: 1, defines the principles and requirements of pre-loan investigation, focusing on investigating first source of repayment, and a double investigation. 2, the provision of customer information: (1) "available on request" information, customer reference case where the account manager deciding whether to request; (2) proof of income can refer to the approach in annex format or other format to meet the Bank's requirements; (3) loan operation shall provide the information management unit; (4) copy of the account manager shall verify the information and sign it to confirm. 3, provided for a borrower, guarantor and main contents of units operated by pre-loan investigation. 4, loans for business and apply for amounts in excess of 500,000 yuan, account managers should refer to the measurement limit estimates demand for working capital loans. (G) loans: the loan origination process, provides lenders responsible for review. (H) loans to pay: defined the trustee payments and autonomous operational requirements for payment.
本文档为【java面试题及答案】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_348501
暂无简介~
格式:doc
大小:104KB
软件:Word
页数:33
分类:生活休闲
上传时间:2018-10-29
浏览量:26