![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java练习
赤瞳寓言
加油!
展开
-
leetcode第一道
Question: Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not翻译 2017-08-31 09:31:09 · 171 阅读 · 0 评论 -
java基础——类的初始化
下面程序的输出是什么?class X{ Y y=new Y(); public X(){ System.out.print("X"); } } class Y{ public Y(){ System.out.print("Y"); } } public class Z extends X{ Y y=new Y();原创 2017-09-18 11:36:37 · 356 阅读 · 0 评论 -
java基础——String和StringBuffer的区别
String: 是对象不是原始类型. 为不可变对象,一旦被创建,就不能修改它的值. 对于已经存在的String对象的修改都是重新创建一个新的对象,然后把新的值保存进去. String 是final类,即不能被继承. StringBuffer: 是一个可变对象,当对他进行修改的时候不会像String那样重新建立对象 它只能通过构造函数来建立, StringBuffer sb原创 2017-09-18 14:57:36 · 548 阅读 · 0 评论 -
java基础——练习题纠错一
第一题: public class Pvf{ static boolean Paddy; public static void main(String argv[]){ System.out.println(Paddy); } } 编译运行以上代码会出现什么情原创 2017-09-19 20:00:48 · 1377 阅读 · 0 评论