在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ HTML/ 字符串基礎問題
什么是 servlet?
HashMap 和 Hashtable
一個線程的初始狀態(tài)是什么?
Pointcut
SQL
Scrum 中的三大角色
Static 關鍵字
靜態(tài)變量和實例變量的區(qū)別?
合并
Initialization and Cleanup
字節(jié)流與字符流
抽象 abstract
& 與 &&
super 關鍵詞
如何序列化一個對象到一個文件?
構造器是否可以被 override
說一說 Java
Callable statement?
What does web module contain?
設計一對一
異常
What is Session in Hibernate?
ApplicationContext 的實現都有哪些?
@Autowired @Inject @Resource
處理異常的方法
Where 和 Having
Visitor Pattern
Java
JSP 的生命周期?
什么是對象 (Object)?
接口 Interface
sleep() 和 wait() 的區(qū)別
Super 程序題
Linux
Run-Time Data Areas - 運行時數據區(qū)域
this() 和 super() 在構造體里怎么用?
what are benefits of using spring?
序列化時引用的處理?
Servlet 必須實現什么接口?
hibernate 的三種狀態(tài)
get and load
IoC 的類型?
Multi-Thread
error 和 exception?
序列化時 static 域的處理?
同步 synchronized
Join point?
面向對象的特征有哪些方面
Programme
What is SessionFactory in Hibernate?
創(chuàng)建 servlet
statement 和 prepared statement?
必須實現 Serializable 接口的哪個方法?
HashMap HashTable LinkedHashMap TreeMap
What is the file extension used for hibernate mapping file?
int 與 integer
Problem on chain
What are the steps in the JDBC connection?
查找文件
IoC containers 類型?
multi to multi
Connection Pooling ?
Spring
序列化時要注意什么?
Externalizable 接口?
StringBuffer 相關問題
如何控制 serialization 的過程?
What does the Class.forName("MyClass") do?
Full join
JSP
Bean Factory 與 ApplicationContext 的區(qū)別?
Introduction?
Transient 關鍵字
Ear, Jar 和 War 文件的區(qū)別?
What do you understand by JSP Actions?
servlet 生命周期?
J2EE客戶端有哪些類型?
作用域的區(qū)別
Java Data Types - Java 數據類型
Static 相關問題
多態(tài) Polymorphism
synchronized method 和 synchronized statement?
什么是自動裝配
GC 就一定能保證內存不溢出嗎?
Singleton bean 是線程安全的嗎?
Spring 都有哪些模塊?
ArrayList 和 Vector
heap 和 stack
preemptive scheduling 和 time slicing?
abstract 相關問題
所有的線程都必須實現哪個方法?
你更傾向于哪種 DI
Collection
一個 .java 源文件是否可以包含多個類
每一個 try 都必須有一個 catch 嗎?
JSP translation?
基礎程序題
都使用過哪些join?
守護線程 daemon thread?
如何實現 muliti-thread?
What are considered as a web component?
封裝 Encapsulation
Bean lifecycle
什么是 Spring 的配置文件?
final 關鍵字
數組相關問題
Article11
Does Java support multiple inheritance?
SessionFactory 是線程安全的嗎?
接口和抽象的區(qū)別
Singleton 單例模式
DAO
What's sprint?
Scrum
How to scrum
列舉出2個 IDE
== 和 equal 的區(qū)別
Hibernate
Hibernate是什么?
Annotation-based container configuration?
inner join
列出文件列表
Collection 相關問題
What type of wildcards have you used?
try 模塊里的 return
final, finally, finalize的區(qū)別
Java 為什么是高效的 ( High Performance )?
One to multi
Gabage Collection
通知的類型?
什么是依賴注入 - Dependency Injection?
How can you inject Java Collection in Spring?
integer 通過 == 比較
所有類的基類是哪個類?
反射機制
什么是 Spring beans?
Continuous integration
一個類是由哪些變量構成的?
什么是 AOP?
equals() 與 hashcode()
都有哪些 bean scope?
序列化 serialization
JSP language
什么是 Spring?
什么是事務 - transaction
this 程序題
J2EE 應用的四個部分?
Stored Procedure?
URI 和 URL?
JDK JRE JVM?
Path 與 Classpath?
Left/Right join
字符串基礎問題
IoC 有什么好處?
What does application client module contain?
sorted 和 ordered collection
把對象聲明成異常
Union 和 Union all?
什么是 J2EE?
什么情況下要使用序列化?
基礎概念題
Checked 異常與 Runtime 異常
異常選擇題
IoC container 是什么?

字符串基礎問題

題目一

public class Test{
    public static void main(String[] args){
        String s1 = "abc";
        String s2 = s1;
        String s3 = new String("abc");
        String s4 = new String("abc");
        String s5 = "abc";

        System.out.println(s1==s5);
        System.out.println(s1==s2);
        System.out.println(s1.equals(s2));
        System.out.println(s3==s4);
        System.out.println(s1.equals(s4));
        System.out.println(s3.equals(s4));
    }
}

輸出是 true true true false true true

記住 == 比較引用. equals 比較值. String 對象會創(chuàng)建一個字符串池 (a pool of string), 如果當前準備新創(chuàng)建的字符串對象的值在這個池子中已經存在,那么就不會生成新對象, 而是復用池中已有的字符串對象. 不過, 只有采用 Object s = “Hello” 方式 (而非用”new“關鍵字) 聲明 String 對象的時候這個規(guī)則才會被應用.

題目二

    String s = "a" + "b" + "c" + "d" + "e"

創(chuàng)建了幾個對象? 1個 賦值號右邊都是常量,編譯時直接儲存它們的字面值, 在編譯時直接把結果取出來面成了 "abcde"

題目三

# 創(chuàng)建了幾個String Object?二者之間有什么區(qū)別?

    String s = new String("xyz");

兩個或一個, ”xyz”對應一個對象, 這個對象放在字符串常量緩沖區(qū), 常量”xyz”不管出現多少遍, 都是緩沖區(qū)中的那一個. New String每寫一遍, 就創(chuàng)建一個新的對象, 它一句那個常量”xyz”對象的內容來創(chuàng)建出一個新String對象. 如果以前就用過’xyz’, 這句代表就不會創(chuàng)建”xyz”自己了, 直接從緩沖區(qū)拿.

題目四

    String s1 = new String("777");
    String s2 = "aaa777";
    String s3 = "aaa" + "777";
    String s4 = "aaa" + s1;

s2 == S3 : true s2 == S4 : false s2 == S4.intern() : true

題目五

    String str = "ABCDEFGH";
    String str1 = str.substring(3,5);
    System.oout.println(str1);

輸出是 DE substring 是前包括后不包括

題目六

    執(zhí)行后,原始的 String 對象中的內容到底變了沒有?

        String s = "Hello";
        s = s + " world!";

沒有. 因為 String 被設計成不可變(immutable)類, 所以它的所有對象都是不可變對象.

在這段代碼中, s原先指向一個String對象, 內容是 "Hello",然后我們對s進行了+操作, 這時,s不指向原來那個對象了, 而指向了另一個 String對象, 內容為"Hello world!", 原來那個對象還存在于內存之中, 只是s這個引用變量不再指向它了.

題目七

執(zhí)行后,輸出是什么? 共創(chuàng)建了幾個字符串對象?

       String s = " Hello ";
       s += " World ";
       s.trim( );
       System.out.println(s);

再次強調 String 是不可變(immutable)類. 所以共創(chuàng)建了三個對象. 最后輸出是 " Hello World ". 只有 s = s.trim() 之后才是 "Hello World".