Idea快捷键

main/psvm 加 enter = public static void main(String[] args){}
sout + enter 或者 "helloworld".sout + enter = System.out.println();
public static void main(String[] args) {}

// main  和  psvm 快捷键入当前代码


System.out.println();
System.out.println("helloworld");

// sout + enter  或者 "helloworld".sout + enter
Ctrl + D  复制当前行内容到下一行
Ctrl + Y 删除当前行
Ctrl + X 剪切当前行和Ctrl + Y效果相同
Ctrl + Alt + L 格式化代码,可以直接快捷键作用于全部代码,用鼠标引用一行就是格式化一行和选中的内容
public class HelloWorld {
    public static void main(String[] args) {
                System.out.println("HelloWorld");
            System.out.println("HelloWorld");
        System.out.println("HelloWorld");
        System.out.println("HelloWorld");
        //12
    }
}
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("HelloWorld");
        System.out.println("HelloWorld");
        System.out.println("HelloWorld");
        System.out.println("HelloWorld");
        //12
    }
}
Ctrl + Shift + 向上的箭头 ;将本行代码向上移动一行
Ctrl + Shift + 向下的箭头 ;将本行代码向下移动一行
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("h1");
        System.out.println("h2"); //Ctrl + Shift + 向上箭头
        System.out.println("h3");
    }
}
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("h2"); //Ctrl + Shift + 向上箭头
        System.out.println("h1");
        System.out.println("h3");
    }
}
Ctrl + / 或者 Ctrl + Shift + /    注释代码

Ctrl + /  单行注释

Ctrl  + Shift + / 多行注释

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("h2"); //Ctrl + Shift + 向上箭头
        System.out.println("h1");
        System.out.println("h3");
        
//         Ctrl + /
        /*  Ctrl + Shift + /  */
    }
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值