广州面试题------广州翔梦信息技术有限公司

部分答案:

1.

$("#btn").click(function(){
var div = $("#div");
if ( div.css("display") === "none" ) {
div.show();
} else {
div.hide();
}

}

2.在jdk1.7以下版本,switch的参数类型只能是:int 或者 enum,在jdk1.7及以上版本,参数可以为String类型


3.
对于short s1 = 1; s1 = s1 + 1; 由于s1+1运算时会自动提升表达式的类型,所以结果是int型,再赋值给short类型s1时,编译器将报告需要强制转换类型的错误。对于short s1 = 1; s1 += 1;由于 += 是java语言规定的运算符,java编译器会对它进行特殊处理,因此可以正确编译。

4.

标号:(跳出的位置)

循环内:break  标号;



5.EexceptionA


6.

File file=new File("H:\\");
        for(File temp:file.listFiles()){
            if(temp.isDirectory()){
                System.out.println(temp.toString());
            }
            
        }


7.

饿汉式
class Singleton {
private static Singleton instance=new Singleton();
private Singleton(){}
static Singleton getInstance() {
return instance;
}
}
懒汉式
class Singleton {
private static Singleton instance=null;
private Singleton(){}
static Singleton getInstance() {
if(instance==null)
instance=new Singleton();
return instance;
}
}

8.
select year,
(select amount from   aaa m where month=1   and m.year=aaa.year) as m1,
(select amount from   aaa m where month=2   and m.year=aaa.year) as m2,
(select amount from   aaa m where month=3   and m.year=aaa.year) as m3,
(select amount from   aaa m where month=4   and m.year=aaa.year) as m4
from aaa   group by year;

9.
public static void main(String[] args) throws Exception {

    ArrayList<Student> list = new ArrayList<>();
    
    list.add(new Student(1, 1, "学生1"));
    list.add(new Student(2, 2, "学生2"));
    list.add(new Student(3, 3, "学生3"));
    list.add(new Student(4, 4, "学生4"));
    list.add(new Student(5, 5, "学生5"));
    list.add(new Student(6, 6, "学生6"));
    list.add(new Student(7, 7, "学生7"));
        
    list = removeEven(list);
        
    System.out.println(list);
    }

    private static ArrayList<Student> removeEven(ArrayList<Student> list) {
        
        Iterator<Student> iterator = list.iterator();
        
        while(iterator.hasNext()){
            
            if (iterator.next().studentNo%2==0) {
                iterator.remove();
            }
        }
        
        return list;
    }

10.

:include 动态包含(分别编译)

:useBean动作(jsp页面使用javaBean的第二种方式)

:getProperty动作(nameuseBean动作中的id)

:setProperty动作(nameuseBean动作中的id)

:param动作(传递参数))

:forward动作(跳转页面)

:plugin动作(用于指定在客户端运行的插件)


11、
jQuery使用document.ready来保证所要执行的代码是在DOM元素被加载完成的情况下执行。
可以简单理解为页面加载完成后执行 document ready内的代码。

12.本质上没区别。只是函数有如:只能返回一个变量的限制。而存储过程可以返回多个。而函数是可以嵌入在sql中使用的,可以在select中调用,而存储过程不行。执行的本质都一样。

13.
主键:ALTER TABLE `table_name` ADD PRIMARY KEY ( `column` ) ;
唯一索引:ALTER TABLE `table_name` ADD UNIQUE ( `column`) ;
索引:ALTER TABLE `table_name` ADD INDEX index_name ( `column` ) ;
联合索引:ALTER TABLE `table_name` ADD INDEX index_name ( `column1`, `column2`, `column3` )


14.

小0大5,

小4大6,

小5大4,

小3大6


16.
static A
static B
I'm A class
Hello A
I 'm B class
Hello B

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值