1、idea 下载地址
https://xclient.info/s/intellij-idea.html
2、idea 破解方法
https://www.cnblogs.com/MrYang-11-GetKnow/p/16470553.html 主要是后面那个脚本
3、java 常用快捷提示和基础语法
psvm
public static void main 程序主入口
sout
System.out.println(); 快速输出日志
基本数据类型
//数据类型
//1、基本数据类型
// 1.1 数值型
// 1.1.1 整数类型(byte,short,int,long)
// 1.1.2 浮点类型(float,double)
// 1.2 字符型 (char)
// 1.3 布尔型 (boolean)
//2、引用数据类型
// 2.1 类 (class)
// 2.2 接口 (interface)
// 数组 []
方法案例
public class TestMethod {
public static int add(int num1,int num2) {
int num = num1 + num2;
return num;
}
public static int add(int num1,int num2,int num3) {
int num = num1 + num2 + num3;
return num;
}
public static void main(String[] args) {
int a =add(1,2);
int b =add(1,2,3);
System.out.println("a:"+a);
System.out.println("b:"+b);
}
类案例
Teacher
public class Teacher {
String name;
int age;
public void say() {
System.out.println("我是" +name +"现在" +age +"岁");
}
public Teacher(String name,int age) {
this.name = name;
this.age = age;
}
}
TeacherClass
public class TestClass {
public static void main(String[] args) {
Teacher teacher1 =new Teacher("熊川宇",18);
teacher1.say();
}
}
继承案例
Annimal
public class Annimal {
String name;
public Annimal(String name) {
this.name = name;
}
public Annimal() {
}
public void say() {
System.out.println(this.name);
System.out.println("我是"+this.name);
}
}
Cat
public class Cat extends Annimal {
public Cat(String name) {
System.out.println("new Cat"+name);
this.name = name;
}
}
Dog
public class Dog extends Annimal {
public Dog(String name) {
System.out.println("new Dog"+name);
this.name = name;
}
}