我的问题是,如果实习生正在使用字符串和具有 SPC(字符串池常量)的字符串,并且实习生概念也使用整数,那么是否有任何整数池常量?如果没有,那么它是如何工作的?
class InternExample
{
public void print()
{
Integer i=10;
Integer j=10;
String c="a";
String s="a";
System.out.println(i==j);// prints true
System.out.println(c==s);//prints true
}
public static void main(String args[])
{
new InternExample().print();
}
}