Java
文章平均质量分 68
昵称居然已经存在了
好好学习,天天向上。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Idea中Java项目—Cannot resolve symbol
一、现象描述一直用intellij Idea开发,最近发生了灵异事件,有一个类明明存在,但总是亮眼的红色,提示:cannot resolve symbol,如图所示:二、解决方式1. 首先确定自己的类是真是存在的!2. 在IDEA中 点击 File → Invalidate Caches/Restart,清理了缓存重启IDEA就OK了...原创 2020-04-21 12:13:26 · 7565 阅读 · 1 评论 -
Java读取Excel文件转Json
Java读取Excel文件转Json一、安装POI和fastjson依赖<!--POI--><dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.9</version>&...原创 2019-09-19 15:01:49 · 4840 阅读 · 0 评论 -
简单工厂模式
一、功能讲解面向对象的继承来实现多态,以从工厂里面根据参数类型的不同,初始化不同类型的实例,得到不同的结果。增加了代码的可复用性,灵活性,可扩展性。二、示例说明Input:两个数和操作方式。Example:3 + 3Output:计算结果。Example:6三、设计思路一个Operation父类,包含两个属性来表示两个数,一个getResult方法来获取结果。每一种操作方式都继承O...原创 2019-06-28 12:48:06 · 188 阅读 · 0 评论 -
Java 用 PhantomJS+ECharts 后台生成图片
第一步:下载并安装PhantomJS方法一:下载地址:http://phantomjs.org/download.html下载完成后解压,然后复制 bin 下面的 phantomjs 到 /usrlocal/bin/cp bin/phantomjs /usr/local/bin/phantomjs方法二:brew安装brew update && brew insta...原创 2019-04-22 11:56:25 · 8758 阅读 · 8 评论 -
Leetcode Num.38 -- Count and Say
题目描述: The count-and-say sequence is the sequence of integers with the first five terms as following:1. 12. 113. 214. 12115. 111221 1 is read off as “one 1” or 11. 11 is r原创 2017-12-04 18:02:43 · 210 阅读 · 0 评论 -
Leetcode Num.168 -- Excel Sheet Column Title
题目描述: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -> A2 -> B3 -> C...26 -> Z27 -> AA28 -> AB 解题思路:根据规律,能看到是以26为循环的,类似于26循环制,所以,只需原创 2017-12-04 17:44:57 · 198 阅读 · 0 评论 -
Leetcode Num.169 -- Majority Element
题目描述: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majority ele原创 2017-12-04 17:37:50 · 200 阅读 · 0 评论 -
用POI读取Excel表格中的值并存储为TXT文件
package Service;import java.io.File;import java.io.FileInputStream;import java.io.FileWriter;import java.io.IOException;import org.apache.poi.hssf.usermodel.HSSFCell;import org.apache.原创 2015-09-19 09:35:53 · 680 阅读 · 0 评论 -
Leetcode 练习——Remove Element
题目描述:Given an array and a value, remove all instances of that > value in place and return the new length.The order of elements can be changed. It doesn’t matter what you leave beyond the new length.输入例原创 2017-03-28 10:24:54 · 295 阅读 · 0 评论 -
读取txt文件中的值并用myBatis将对象插入到数据库中
/**读取txt中的值存入list中**/package Service;import java.io.*;import java.util.ArrayList;import java.util.List;import PO.tablePo;public class textRead {private String fileName;pr原创 2015-09-19 09:45:33 · 3148 阅读 · 0 评论 -
Java语言用jfreechart绘制柱状图、饼状图和时序图
1.柱状图:public void test1() { try { //设置字体 StandardChartTheme sct = new StandardChartTheme("CN"); sct.setExtraLargeFont(new Font("隶书", Font.BOLD, 20)); sct.setRegularFont(new Fon原创 2015-02-09 11:33:41 · 2156 阅读 · 2 评论 -
Java语言用POI操作Excel
用POI对Excel进行操作。包括创建单元格,改变字体颜色,合并单元格,设置背景颜色等等。原创 2015-02-03 16:28:20 · 607 阅读 · 0 评论 -
Java中的多线程—经典例题
经典例题1:生产者/消费者问题。题目描述:生产者(Productor)将产品交给店员(Clerk),而消费者(Customer)从店员处取走产品,店员一次只能持有固定数量的产品(比如:20),如果生产者试图生产更多的产品,店员会叫生产者停一下,如果店中有空位放产品了再通知生产者继续生产;如果店中没有产品了,店员会告诉消费者等一下,如果店中有产品了再通知消费者来取走产品。public cl...原创 2015-01-29 16:00:13 · 1315 阅读 · 0 评论 -
输入输出流(IO)—文件字符流(FileReader & FileWriter)的基本操作及应用
FileReader类是Reader类的子类,称为文件字符输入流。按字符读取文件中的数据。构造方法:FileReader(String name) FileReader(File file)读取文件并输出public void test() throws IOException{File file = new File("hello.txt原创 2015-01-27 14:45:14 · 785 阅读 · 0 评论 -
输入输出流(IO)—文件字节流(FileInputStream & FileOutputStream)的基本操作及运用
FileInputStream类是InputStream类的子类,称为文件字节输入流。按字节读取文件中的数据。构造方法:FileInputStream(String name) FileInputStream(File file)读取文件并输出:public void test() throws IOException{File file原创 2015-01-27 13:28:07 · 758 阅读 · 0 评论 -
集合中的Collections排序和Map排序
请从键盘随机输入10个整数保存到List中,并按倒序、从大到小的顺序显示出来@Testpublic void test4(){Scanner r = new Scanner(System.in);List list = new ArrayList();for(int i=0;iint x = r.nextInt();list.add(x);}Collection原创 2015-01-22 13:53:05 · 927 阅读 · 0 评论 -
Java中的集合排序(自然排序 & 定制排序)
1. 定义一个Employee类,该类包含:private成员变量name,age,birthday,其中 birthday 为 MyDate 类的对象;并为每一个属性定义 getter, setter 方法;并重写 toString 方法输出 name, age, birthday MyDate类包含:private成员变量month,day,year;并为每一个属性定义原创 2015-01-21 16:59:34 · 7246 阅读 · 0 评论 -
JMX 获取MBean信息
我们都知道JDK里边自带的 jmap 命令可以获取到 JVM 的内存信息。为了事实监控 JVM 的状态,需要在一定的周期内持续获取数据。通过搜索,知道了 JMX(Java Management Extensions)JMX下载地址jmx_example.zip下载地址解压 jmx_example.zip:unzip jmx_examples.zip编译com/example下的java程序:jav原创 2017-03-28 10:16:06 · 2795 阅读 · 0 评论
分享