- 博客(24)
- 收藏
- 关注
原创 初学日志,格式器。
建立与设置日志 package newlearn; import java.io.IOException; import java.util.logging.*; public class logtext { public static void main(String[] args) throws SecurityException, IOException { Logger lg = Logger.getLogger("MyLog"); FileHandler fh = n
2022-05-24 11:57:57
111
原创 进一步学习使用try and catch
package newclass0523; import java.util.InputMismatchException; import java.util.Scanner; public class numberFormat { public static void main(String[] args) { int a, b; boolean flog = false; while(!flog) { System.out.println("输入两个数字"); .
2022-05-23 11:25:26
123
原创 Try and Catch
package newlearn; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class TextOfJava { public static void main(String[] args) { try { Scanner in = new Scanner(new File("src//newlearn//data.txt")); .
2022-05-19 11:57:36
175
原创 MATHTOOL
package STRINGTEXT; public class MathTool { private int x, y; public MathTool(int a, int b) { x = a; y = b; } public int add() { return x + y; } public int substract() { return x - y; } public int gcd() { int p = 1; for(int i =.
2022-05-17 11:43:18
493
原创 MobilePhone
package STRINGTEXT; public interface A { public abstract void setCallPrice(int t); } package STRINGTEXT; public interface B { public abstract void setMessagePrice(int a); } package STRINGTEXT; public interface C extends A, B { public abstr.
2022-05-17 11:34:25
635
原创 java实现简单窗口,接口,按钮。
package newclass; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class myFrame extends JFrame implements ActionListener { private JPanel panel; private JButton myButto.
2022-05-16 10:56:28
533
原创 java实现简单的收银员系统
package v2_3; public class Item implements Comparable<Item> { private String number; //编号 private String name; private double price; private double quantity; public Item(String number, String name, double price, double quantity) { super().
2022-05-10 10:36:20
1258
2
原创 Java comparable接口的实现。
package class20220509; public class person implements Comparable<person> { private String name; private int age; public person(String na, int ag) { name = na; age = ag; } public String getName() { return name; } public void setName.
2022-05-09 11:21:25
530
原创 java实现简易通讯录,初学类与对象
package people; public class contacts { private String name; private String email; private String wechat; private String number; private int flog = 1; public contacts(String na, String nu, String em, String we) { name = na; email = em; .
2022-04-07 15:10:31
753
原创 C语言两种方法实现斐波那契数列
int Fb1(int i) { int x1, x2, an, n; x1 = 0; x2 = 1; an = 1; n = 1; while (n < i) { n++; an = x1 + x2; x1 = x2; x2 = an; } return an; } 首先是循环法。 int Fb2(int n) { if((n == 1)||(n =.
2022-01-27 22:22:32
2624
原创 C++闰年判断
#include <bits/stdc++.h> using namespace std; int IFRen(int a); int main() { int n, x; scanf("%d", &n); x = IFRen(n); if (x == 1) { printf("YES"); } else printf("NO"); system("pause"); return .
2022-01-27 14:51:13
1296
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅