无聊的面试题

2018-09-12

System.out.println("hello" + 1 + 2);//输出hello12

System.out.println(1 + 2 +"hello");//输出3hello

String s = "a" + "b" + "c" + "d" + "e"; 问此语句共创建了几个对象, http://blog.csdn.net/java2000_net/article/details/3681385

public class Main2 {
    public static void main(String[] args) {
        Student s = new Student();
    }
    public static class Student{
        public Student(){
            System.out.println("Student build");
        }
        
        {
            System.out.println("Student 。。。");
        }
        
        static{
            System.out.println("Student static");
        }
    }
}

输出结果是:

Student static
Student 。。。
Student build

OGNL表达式

<%@ taglib uri="/struts-tags" prefix="s" %>

<s:property value="name" /> 或  <s:property value="stu.name" />

 EL表达式

 ${stu.name} 

2018-09-13

事务的四大特性:原子性,一致性,隔离性,持久性。

2018-09-14

MySQL的四种隔离级别:串行化、可重复读、读已提交、读未提交。

2018-09-25

jsp九对象:

与servlet有关:page、config

与Input/Output有关:out、request、response

与Context上下文有关:application、session、pageContext

与Error有关:exception

2018-09-28

Java 虚拟机不仅要看类的全名是否相同,还要看加载此类的类加载器是否一样。只有两者都相同的情况,才认为两个类是相同的。即便是同样的字节代码,被不同的类加载器加载之后所得到的类,也是不同的。

 查询学科前2名的sql   博客来源

select * from StudentGrade t
where (select count(1) from StudentGrade where subid=t.subid and grade>t.grade)<=1
order by subId,grade desc

 

posted on 2018-09-12 07:49  angelshelter  阅读(174)  评论(0编辑  收藏  举报

导航