摘要:
拼题a第九题 ```#include #include #include // 求最大公约数 long long gcd(long long a, long long b) { if (b == 0) { return a; } return gcd(b, a % b); } // 分数类定义 cl 阅读全文
posted @ 2023-07-28 21:37
aallofitisst
阅读(11)
评论(0)
推荐(0)
摘要:
Java数组之冒泡排序 ``` public class BubbleSort { public static void main(String[] args) { int[] array = {64, 34, 25, 12, 22, 11, 90}; System.out.println("Ori 阅读全文
posted @ 2023-07-26 22:40
aallofitisst
阅读(10)
评论(0)
推荐(0)
摘要:
pta Java 骑马与砍杀😄 阅读全文
posted @ 2023-07-24 22:12
aallofitisst
阅读(8)
评论(0)
推荐(0)
摘要:
``` ```public class ExceptionHandlingExample { public static void main(String[] args) { try { int result = divide(10, 0); System.out.println("Result: 阅读全文
posted @ 2023-07-22 22:24
aallofitisst
阅读(15)
评论(0)
推荐(0)
摘要:
``` public class HanoiTower { public static void main(String[] args) { int n = 3; // 圆盘的数量 char from = 'A'; // 起始柱子 char aux = 'B'; // 辅助柱子 char to = 阅读全文
posted @ 2023-07-21 21:50
aallofitisst
阅读(12)
评论(0)
推荐(0)
摘要:
``` import java.time.DayOfWeek; import java.time.LocalDate; import java.time.Month; public class Main { public static void main(String[] args) { int y 阅读全文
posted @ 2023-07-19 22:22
aallofitisst
阅读(7)
评论(0)
推荐(0)
摘要:
匿名类 ``` public class Main { public static void main(String[] args) { Thread thread = new Thread(new Runnable() { public void run() { System.out.printl 阅读全文
posted @ 2023-07-15 19:52
aallofitisst
阅读(12)
评论(0)
推荐(0)
摘要:
Java抽象类 ``` abstract class Shape { abstract double calculateArea(); // 抽象方法 } class Rectangle extends Shape { private double length; private double wi 阅读全文
posted @ 2023-07-14 19:32
aallofitisst
阅读(9)
评论(0)
推荐(0)
摘要:
public:公共访问修饰符,表示类成员可以在任何地方被访问,没有访问限制。 private:私有访问修饰符,表示类成员只能在声明它的类内部访问,其他类无法直接访问。 protected:受保护的访问修饰符,表示类成员可以在声明它的类内部和子类中访问,但对于同一包中的其他类是不可访问的。 默认访问修 阅读全文
posted @ 2023-07-11 19:15
aallofitisst
阅读(13)
评论(0)
推荐(0)
摘要:
Java方法重载 ``` class MathUtils { public static int add(int a, int b) { return a + b; } public static double add(double a, double b) { return a + b; } pu 阅读全文
posted @ 2023-07-10 19:26
aallofitisst
阅读(6)
评论(0)
推荐(0)
浙公网安备 33010602011771号