自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Charles095的博客

A rookie who is learning Java

  • 博客(17)
  • 收藏
  • 关注

原创 Java 读取文件出现乱码的问题

昨天写作业时遇到的问题,因为储存数据的txt文件是使用UTF-8编码的,用平常常用的FileReader去读取的话部分中字符号(eg: “ ”)会出现乱码的现象。一开始有点头疼,后来浏览SStack Overflow时找到了解决方案(https://stackoverflow.com/questions/37940919/scan-input-with-utf-8/37940968)try {...

2019-11-01 09:55:41 454

原创 Java —— Leetcode Easy problem #3 (easy in 50-100 )

53. Maximum SubarrayGiven an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],O...

2019-07-23 17:22:26 286

原创 Java —— Leetcode Easy problem #2 (easy in 21-50 )

21. Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, ...

2019-07-18 15:00:32 262

原创 Java 刷题笔记——singly ListNode

Definition for singly-linked list.public class ListNode { int val; ListNode next; ListNode(int x) { val = x; }}(图片来自https://www.cnblogs.com/ysocean/p/7928988.html)生成新的ListNode:...

2019-07-17 16:26:34 510

原创 Java —— Leetcode Easy problem #1 (1-20 )

After learning the basics of Java, I started solving some easy questions on LeetCode in Java. Now I plan to practice a few questions every day and this will be my notes of solving problems.1. Two Sum...

2019-07-17 11:02:23 256

转载 Simple ChatClient (Head First Java Version)

This is the mini project of the fifteenth chapter that can help review the knowledge points in the network and threads. Before you start, run the server program and then the client program. Because...

2019-07-11 17:24:54 408 1

原创 JAVA学习日志8 网络与线程 (Head First Java 1907010)

第十五章 网络与线程1. 网络socket连接Socket是个代表两台机器之间网络连接的对象(java.net.Socket)。这里连接指得就是两个机器之间知道如何识别并与对象产生通信的一种关系。这里其实涉及到很多低层的工作细节,但是得益于java API的网络功能包(java.net),我们只需要处理高层部分的内容。要创建Socket连接你必须了解两项关于服务器的信息:IP地址(他在哪)及...

2019-07-11 16:59:42 198

转载 QuizCard Builder and Player (Head First Java Version)

After learning Serialization and file input and output, the book introduce us a very interesting tiny-project. I want to record it here for review in the other day and share it with internet firends....

2019-07-08 09:39:33 668

原创 JAVA学习日志7 序列化的文件的输入/输出 (Head First Java 190704)

第十四章 序列化的文件的输入/输出

2019-07-05 18:00:29 260

转载 TinyProject -- Easy BeatBox (Head First Java Version)

This is the code of a easy beatbox which come from Head First Java and I just want to share it with some website friend. You can design your own electronic stuff by clicking those boxes with diffrent ...

2019-07-02 17:32:28 288

原创 JAVA学习日志6 Swing (Head First Java 190701)

第十三章 运用Swing1. swing的组件组件(component,或称元件)是比我们之前所称的widget更为正确的术语。它们就是你放在GUI上的东西。这些东西是用户会看到并与其交互的,像是Text Field、 button、 scrollable list、radio button等。事实上所有的组件都是继承自javax.swing.JComponent。组件是可以进行嵌套的。你可...

2019-07-02 11:27:27 243

原创 JAVA学习日志5 图形用户接口 (Head First Java 190630)

第十二章 图形用户接口1. 第一个GUI我们用JFrame来作图像用户接口。一旦创建出JFrame后,你就可以把组件(widget)加到上面。有很多的Swing组件可以使用,它们在javax.swing这个包中。最常使用的组件包括: JButton、JRadioButton、JCheckBox、JLabel、JList、JScrollPane、JSlider、JTextArea、JTextFi...

2019-07-01 11:24:51 344 1

原创 JAVA学习日志4 异常处理 (Head First Java 190627)

第十一章 异常处理1. 异常处理Java的异常处理(exception-handling)机制是个简捷、轻量化的执行期间例外状况处理方式,它让你能够将处理错误状况的程序代码摆在一个容易阅读的位置。我们可以通该方法的声明throw语句来得知该方法可能会出现的异常。通常把有风险的程序代码放在try/catch块中,异常是一种exception类型的变量try{ //危险动作} catch(...

2019-06-27 18:01:37 179

原创 JAVA学习日志3 数字与静态 (Head First Java 190626)

第十章 数字与静态1. 静态方法之前我们用到的方法大部分都需要通过变量及对象来实现。但是静态方法是一种不需实例变量及对象行为也能够实现的方法。static这个关键词可以标记出不需要类变量的方法。public static int main(int a, int b){} //返回a与b中的较小的值带有静态变量方法的意义: 这些类通常不打算被初始化(不一定)。我们可以用抽象类abstr...

2019-06-26 16:16:20 138

原创 JAVA 学习日志2 构造器与垃圾收集器(Head First Java 190621)

第九章 构造器与垃圾收集器1. 栈与堆关于内存,我们一般会比较在乎内存中的两个区域:对象的生存空间堆(heap)和方法调用及变量的生存空间(stack)。变量一般分为实例变量和局部变量。实例变量声明在类中,存在于所属的对象中。局部变量和方法的参数都是被声明在方法中,它们的生命周期只限于被放在栈上这段周期。引用变量(‘遥控器’,起连接堆中对象功能,本身不存放)既可以是实例变量也可以为局部变...

2019-06-21 18:02:34 177

原创 JAVA学习日志1 接口与多态(Head First Java 190619)

第八章 接口与多态暑期实习刚好处在开发工作岗上,因为之前没有太接触过JAVA,所以开启边学边用模式。其实已经开始学习一个星期了,但是直到今天才开始打算写博客。作为一个程序菜鸡,记录一下学习记录吧。1. 抽象与具体上一章主要内容主要是JAVA中如何继承,这一章首先说明我们一般声明引用变量的时候将其与具体对象相连接,例如:Wolf awolf = new Wolf();Animal Ah...

2019-06-20 11:33:12 158

原创 Leetcode Easy problem #1

Leetcode Easy problem(Python June 19. 2019)This is written to record the experience I solve the leetcode easy problems. I will take down some algorithm which I prefer and record some point where I m...

2019-06-19 15:29:42 206

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除