![](https://img-blog.csdnimg.cn/20190918140012416.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
一些面试题
顾名思义,遇到的面试题
oqiolalala
一个java菜鸟
展开
-
mybatis核心处理类是什么
SqlSessionFactoryBuilder:它是每一个MyBatis的应用程序的入口。 通过XML配置文件创建Configuration对象,也可以在程序中自行创建,然后通过build方法创建SqlSessionFactory对象。没有必要每次访问Mybatis就创建一次SqlSessionFactoryBuilder,通常做法是创建一个全局的对象。SqlSessionFactory:SqlSessionFactory对象的主要功能是创建SqlSession对象。 通过SqlSession.原创 2021-08-03 22:31:35 · 1095 阅读 · 0 评论 -
union和union all的区别
UNION 内部的 SELECT 语句必须拥有相同数量的列。列也必须拥有相似的数据类型。同时,每条 SELECT 语句中的列的顺序必须相同。union去重。union all不去重。测试一下,两张表,test01,test02select name from test.test01select name from test.test02union去掉了两张表中重复的字段select name from test.test01unionselect name from test.原创 2021-08-02 18:55:41 · 70 阅读 · 0 评论 -
int[] x = new int[10];
A.x[9]为0B.x[9]未定义C.x[10]为0D.x[0]为空public class Test { public static void main(String[] args) { int[] x = new int[10]; System.out.println("x[9] = " + x[9]); }}答案Ax[10]抛异常ArrayIndexOutOfBoundsException...原创 2021-08-02 18:12:28 · 2814 阅读 · 0 评论 -
定义线程的执行体的方法
以下哪个方法用于定义线程的执行体? ( )A.start()B.init()C.run()D.synchronized()答案:Cstart()是线程开始执行init()是初始化run()是定义线程内部执行的方法synchronized()是处理多线程同步用的原创 2021-08-02 17:55:39 · 5937 阅读 · 0 评论 -
String初始化的一题
下面代码的结果是什么A.代码得到编译,输出"a="B.代码得到编译,输出"a=null"C.由于String a没有初始化,代码不能编译通过D.代码得到编译,但捕获异常NullPointExceptionpublic class Test { public static void main(String[] args) { String a; System.out.println("a=" + a); }}答案:C,编译不通过初始化后:原创 2021-08-02 17:45:52 · 558 阅读 · 0 评论 -
finally的一个面试题
下面java代码的运行结果A.13423B.24313C.14323D.13243public class test { public static String output = ""; public static void foo(int i) { try { if (i == 1) { throw new Exception(); } output += "原创 2021-07-24 20:01:48 · 78 阅读 · 0 评论 -
递归获取一个路径下所有文件的路径
import java.io.File;public class GetFilesPath { public static void main(String[] args) { //路径 String path="D:\\tools\\test"; //方法 getFilesPath(path); } public static void getFilesPath(String path) { Fi原创 2021-07-24 18:57:24 · 107 阅读 · 0 评论 -
列举数据库中的关键字,如select;列举数据库中的函数,如to_char;列举数据库中的对象,如表;
遇到的面试题一、关键字(一)增insert(二)删delete(三)改update(四)查select按照执行顺序排列:from,join onwheregroup byhavingselectdistinctorder by asc升序/desc降序limit还有in,not in,lower,like,not like,as等。(五)约束关键字primary key,主键foreign key,外键unique,唯一键default,默认值not null原创 2021-07-24 19:41:15 · 132 阅读 · 0 评论