zoukankan      html  css  js  c++  java
  • 面试题

    package testt;

    public abstract class test2 {
        public static void fun(StringBuffer sb1,StringBuffer sb2) {
            sb1.append(sb2);
            sb2=sb1;
        }
        public static void main(String[] args) {
            StringBuffer a1 = new StringBuffer("we");
            StringBuffer a2 = new StringBuffer("bush");    
            fun(a1,a2);
            System.out.println("a1"+"="+a1+" "+"a2"+"="+a2);
        }
    }
    输出结果:a1=webush a2=bush


    package testt;

    public class test1 {
        static class Person{
            static{
                System.out.println("person init");
            }
        }
        public static void main(String[] args) {
            System.out.println(Person.class.equals(Person.class.getName()));
            System.out.println("===========");
            Person p1 = new Person();
            Person p2 = new Person();
            System.out.println(p1.getClass() == p2.getClass());
        }
        
        
    }
    输出结果:false
    ===========
    person init
    true

    package testt;

    public class test3 {
        static{
            a=3;
        }
        static int a = 5;
        public static void main(String[] args) {
            System.out.println(a);
        }
    }
    输出结果:5

      基本类型       默认值    
    byte 0
    short 0
    int 0
    long 0L
    float 0.0f
    double 0.0d
    char 'u0000'(null)
    boolean false
  • 相关阅读:
    数据库调优2
    数据库调优
    SQL优化
    支付宝/阿里面试题
    Servlet 工程 web.xml 中的 servlet 和 servlet-mapping 标签 《转载》
    《转载》struts旅程《2》
    《转载》struts旅程《1》
    jsp 自定义标签
    body-content取值的意义
    jsp页面中jstl标签详解
  • 原文地址:https://www.cnblogs.com/hello-liyb/p/7800838.html
Copyright © 2011-2022 走看看