- 博客(11)
- 收藏
- 关注
原创 js精度计算保留小数位相关
常用的舍入方法如下:1.四舍五入规则 1.1保留整数位 var a =2.5; var b =5; var re = Number(a*b).toFixed(); 结果:re =13; ---------------------------------------------------------------------------- 1.2保留指定小数位 var a =10; var b =3 ; var re = Number(a/b).toFixed(3); 结果:re =
2021-08-03 10:32:37
312
原创 ajax的格式以及成功和失败函数
//本例新的ajax格式,将成功和失败的回调链式编程紧跟后面,替换原先写在ajax()里面的success:和error: $.ajax({ url : "/Project/uploadFile", type : 'POST', cache : false, data : formData, processData : false, contentType : false, async:true
2021-07-09 14:06:00
2625
转载 java读取properties配置文件的几种方式
项目中经常将一些配置信息放到properties文件中,读取非常方便,下面介绍几种java读取properties配置文件的方式。先看示例的properties文件:方法一,基于InputStream读取配置文件:public static void main(String[] args) { readProperty1();}//方法一private static void readProperty1() { Properties properties = new Proper
2021-07-02 17:43:00
1777
原创 数据库查重复记录
数据库查重复记录1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断代码如下:select * from peoplewhere peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)注意:这里的重复是指所有列的数据相同2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录代码如下:d
2021-07-02 16:52:25
6820
原创 SpringMVC实现Ajax异步登录并获取input标签输入内容
定义一个User实体类用来封装接收的数据public class User implements Serializable { private String userName; private String password; public User() { } public User(String userName, String password) { this.userName = userName; this.passwo
2021-03-05 20:10:13
496
原创 JAVA反射学习笔记
学生类package mytest.day1221;public class Student { public String name; public int age; public void study(){ System.out.println("study方法被调用"); } public void eat(String food){ System.out.println("eat方法被调用"); Sys
2020-12-21 20:32:45
123
原创 字节流结合类,实现简单录入信息,并在本地存储
/*字节流结合类,实现简单录入信息,并在本地存储 */import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.util.ArrayList;import java.util.Scanner;public class Test { public static void main(String[] args) throws IOException {
2020-12-14 22:26:35
168
原创 HashMap的基本使用方法
import java.util.HashMap;import java.util.Map;import java.util.Set;import java.util.Iterator;/*HashMap的基本使用方法增删查改遍历 */public class Test001 { public static void main(String[] args) {//创建对象 HashMap<String, String> hm = new HashMa
2020-12-13 20:06:40
348
原创 好玩的扑克发牌器 Collections.sort()的妙用
import java.util.ArrayList;import java.util.Collections;public class DouDiZhuDemo { public static void main(String[] args) { //准备牌 String[] flowers = {"♠", "♥", "♣", "♦"}; String[] numbers = {"3", "4", "5", "6", "7", "8", "9
2020-12-12 21:05:46
237
原创 int类型数组的自然排序, int类型数组转Integer类型数组 ,Integer数组逆序排序方法
import java.util.Arrays;import java.util.Comparator;import java.util.Random;/*int类型数组的自然排序int类型数组转Integer类型数组Integer数组逆序排序方法 */public class Test { public static void main(String[] args) { Random r = new Random(); int[] array = n
2020-12-12 14:05:08
410
原创 Date相关时间类学习笔记
import java.text.ParseException;import java.text.SimpleDateFormat;import java.time.LocalDateTime;import java.time.format.DateTimeFormatter;import java.util.Date;public class Test {public static void main(String[] args) throws ParseException { //*
2020-12-07 22:33:46
142
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人