博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Java常见笔试、面试题目深度剖析
阅读量:4604 次
发布时间:2019-06-09

本文共 838 字,大约阅读时间需要 2 分钟。

转自:

public class StringTest {    public static void main(String[] args) { String s0 = new String("abc");//此语句产生几个String object String s1 = "abc";//此语句产生几个String object String s2 = new String("abc");//此语句产生几个String object String s3 = "abc"; System.out.println(s0 == s1);//输出true or false System.out.println(s0 == s2);//输出true or false System.out.println(s1 == s2);//输出true or false System.out.println(s1 == s3);//输出true or false System.out.println(s1 == s0.intern());//输出true or false System.out.println(s1 == s1.intern());//输出true or false System.out.println(s1 == s2.intern());//输出true or false String hello = "hello"; String hel = "hel"; String lo = "lo"; System.out.println(hello == "hel" + "lo");//输出true or false System.out.println(hello == "hel" + lo);//输出true or false } }

转载于:https://www.cnblogs.com/jianmang/articles/4878883.html

你可能感兴趣的文章
Minimum Path Sum
查看>>
Remove Duplicates from Sorted Array II
查看>>
常量指针和指针常量巧妙记忆方法[转]
查看>>
python-haproxy作业讲解视频总结
查看>>
mui搜索框 搜索点击事件
查看>>
A == B ?
查看>>
洛谷P3763 [Tjoi2017]DNA 【后缀数组】
查看>>
UVa 442 Matrix Chain Multiplication(矩阵链,模拟栈)
查看>>
多种方法求解八数码问题
查看>>
spring mvc ModelAndView向前台传值
查看>>
(黑客游戏)HackTheGame1.21 过关攻略
查看>>
Transparency Tutorial with C# - Part 2
查看>>
android 文件上传
查看>>
ASCII 码表对照
查看>>
javascript的DOM操作获取元素
查看>>
Shuffle'm Up(串)
查看>>
20145219 《Java程序设计》第06周学习总结
查看>>
C# 执行bat文件并取得回显
查看>>
基于YOLO的Autonomous driving application__by 何子辰
查看>>
javascript中的继承
查看>>