【无标题】

next()方法以空格与回车为结束符

nextLine()方法只以回车为结束符

charAt(int)方法返回下标处的单个字符

toUpperCase() toLowerCase()方法把string全部转换为大小写

hasNext()函数用于多组输入

Map<Integer, Integer> mp = new HashMap<Integer, Integer>();定义map键值对

map.containsKey(key)查询map中是否有key键值

map.get(key),foreach循环可以快速遍历set

String.split(Str)方法可以对String进行分割 分割符为str,返回值为字符串数组

str.compareTo()方法可以比较两个字符串的字典序正序输出负数相等返回0逆序返回一个正数

String str = new String(char[])可以将char数组转化为String类型

Arrays.sort()排序函数

Queue<Integer> que = new LinkedList<Integer>();

PriorityQueue<Integer> que = new PriorityQueue<Integer>();优先队列声明方式

public static Comparator<Integer> Cmp = new Comparator<Integer>(){
        public int compare(Integer a, Integer b){
            return (int)(b - a);
        }
    };比较器Comparator,用于优先队列排序方法等自定义排序规则

ArrayList<Edge>[] Ed = new ArrayList[50];邻接链表

File file = new File("nmd.txt");

Scanner cin = new Scanner(file);

PrintWriter writer = new PrintWriter(file);

/*FileWriter fw = new FileWriter(file2, true);
            PrintWriter writer = new PrintWriter(fw);*/可以在file2文件的基础上追加写内容

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值