xerga před 2 roky
rodič
revize
303b8bbd2c
21 změnil soubory, kde provedl 403 přidání a 1 odebrání
  1. 15 0
      01-JavaSe/.idea/compiler.xml
  2. 20 0
      01-JavaSe/.idea/jarRepositories.xml
  3. 8 0
      01-JavaSe/.idea/misc.xml
  4. 1 1
      01-JavaSe/.idea/modules.xml
  5. 11 0
      01-JavaSe/day10/day10.iml
  6. 50 0
      01-JavaSe/day10/src/com/lovecoding/day10/oop01this/Person.java
  7. 28 0
      01-JavaSe/day10/src/com/lovecoding/day10/oop01this/TestOopThis.java
  8. 84 0
      01-JavaSe/day10/src/com/lovecoding/day10/oop02this/Student.java
  9. 21 0
      01-JavaSe/day10/src/com/lovecoding/day10/oop02this/TestStudent.java
  10. 39 0
      01-JavaSe/day10/src/com/lovecoding/day10/oopex01/Account.java
  11. 37 0
      01-JavaSe/day10/src/com/lovecoding/day10/oopex01/Bank.java
  12. 58 0
      01-JavaSe/day10/src/com/lovecoding/day10/oopex01/Customer.java
  13. 31 0
      01-JavaSe/day10/src/com/lovecoding/day10/oopex01/TestBank.java
  14. binární
      01-JavaSe/out/production/day10/com/lovecoding/day10/oop01this/Person.class
  15. binární
      01-JavaSe/out/production/day10/com/lovecoding/day10/oop01this/TestOopThis.class
  16. binární
      01-JavaSe/out/production/day10/com/lovecoding/day10/oop02this/Student.class
  17. binární
      01-JavaSe/out/production/day10/com/lovecoding/day10/oop02this/TestStudent.class
  18. binární
      01-JavaSe/out/production/day10/com/lovecoding/day10/oopex01/Account.class
  19. binární
      01-JavaSe/out/production/day10/com/lovecoding/day10/oopex01/Bank.class
  20. binární
      01-JavaSe/out/production/day10/com/lovecoding/day10/oopex01/Customer.class
  21. binární
      01-JavaSe/out/production/day10/com/lovecoding/day10/oopex01/TestBank.class

+ 15 - 0
01-JavaSe/.idea/compiler.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile name="Maven default annotation processors profile" enabled="true">
+        <sourceOutputDir name="target/generated-sources/annotations" />
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
+        <outputRelativeToContentRoot value="true" />
+      </profile>
+    </annotationProcessing>
+    <bytecodeTargetLevel>
+      <module name="day10" target="17" />
+    </bytecodeTargetLevel>
+  </component>
+</project>

+ 20 - 0
01-JavaSe/.idea/jarRepositories.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
+      <option name="url" value="https://maven.aliyun.com/repository/public" />
+    </remote-repository>
+  </component>
+</project>

+ 8 - 0
01-JavaSe/.idea/misc.xml

@@ -1,5 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="MavenProjectsManager">
+    <option name="originalFiles">
+      <list>
+        <option value="$PROJECT_DIR$/day10/pom.xml" />
+      </list>
+    </option>
+  </component>
   <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/out" />
   </component>

+ 1 - 1
01-JavaSe/.idea/modules.xml

@@ -5,8 +5,8 @@
       <module fileurl="file://$PROJECT_DIR$/01-JavaSe.iml" filepath="$PROJECT_DIR$/01-JavaSe.iml" />
       <module fileurl="file://$PROJECT_DIR$/day05/day05.iml" filepath="$PROJECT_DIR$/day05/day05.iml" />
       <module fileurl="file://$PROJECT_DIR$/day07/day07.iml" filepath="$PROJECT_DIR$/day07/day07.iml" />
-      <module fileurl="file://$PROJECT_DIR$/day08/day08.iml" filepath="$PROJECT_DIR$/day08/day08.iml" />
       <module fileurl="file://$PROJECT_DIR$/day09/day09.iml" filepath="$PROJECT_DIR$/day09/day09.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day10/day10.iml" filepath="$PROJECT_DIR$/day10/day10.iml" />
     </modules>
   </component>
 </project>

+ 11 - 0
01-JavaSe/day10/day10.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 50 - 0
01-JavaSe/day10/src/com/lovecoding/day10/oop01this/Person.java

@@ -0,0 +1,50 @@
+package com.lovecoding.day10.oop01this;
+
+/**
+ * ClassName: Person
+ * Package: com.lovecoding.day10.oop01this
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/6/18 9:33
+ * @Version 1.0
+ */
+public class Person {
+
+    private String name;
+
+    //set
+
+    public String getName() {
+        return name;
+    }
+
+    //使用属性
+    public void setName(String name) {
+        //类的属性 区分同名问题
+        this.name = name;
+    }
+
+    //调用构造方法
+
+    public Person() {
+        //System.out.println(this); //
+        this("zs");
+    }
+
+    public Person(String name) {
+        this.name = name;
+    }
+
+    //调用方法
+    public void show(){
+        //处理业务
+        System.out.println(this.showInfo());
+    }
+
+    private String showInfo() {
+        return "Person{" +
+                "name='" + name + '\'' +
+                '}';
+    }
+}

+ 28 - 0
01-JavaSe/day10/src/com/lovecoding/day10/oop01this/TestOopThis.java

@@ -0,0 +1,28 @@
+package com.lovecoding.day10.oop01this;
+
+/**
+ * ClassName: TestOopThis
+ * Package: com.lovecoding.day10.oop01this
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/6/18 9:32
+ * @Version 1.0
+ */
+public class TestOopThis {
+
+
+    public static void main(String[] args) {
+        //构造
+        Person person = new Person();
+        //方法
+        person.show(); // zs
+        //属性
+        person.setName("lisi");
+
+        person.show(); //lisi
+
+
+    }
+
+}

+ 84 - 0
01-JavaSe/day10/src/com/lovecoding/day10/oop02this/Student.java

@@ -0,0 +1,84 @@
+package com.lovecoding.day10.oop02this;
+
+/**
+ * ClassName: Student
+ * Package: com.lovecoding.day10.oop02this
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/6/18 9:45
+ * @Version 1.0
+ */
+public class Student {
+
+    private String name;
+    private int age;
+    private String address;
+    private boolean sex;
+
+    public Student() {
+        //默认年龄
+        this("zs",0);
+    }
+
+    public Student(String name, int age) {
+        //构造 第一行 先完成初始化
+        this(name,age,"北京");
+
+    }
+
+    public Student(String name, int age, String address) {
+        this(name,age,address,true);
+    }
+
+    public Student(String name, int age, String address, boolean sex) {
+        //this() n个构造  this() n-1
+        this.name = name;
+        this.age = age;
+        this.address = address;
+        this.sex = sex;
+    }
+
+
+    @Override
+    public String toString() {
+        return "Student{" +
+                "name='" + name + '\'' +
+                ", age=" + age +
+                ", address='" + address + '\'' +
+                ", sex=" + sex +
+                '}';
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public boolean isSex() {
+        return sex;
+    }
+
+    public void setSex(boolean sex) {
+        this.sex = sex;
+    }
+}

+ 21 - 0
01-JavaSe/day10/src/com/lovecoding/day10/oop02this/TestStudent.java

@@ -0,0 +1,21 @@
+package com.lovecoding.day10.oop02this;
+
+/**
+ * ClassName: TestStudent
+ * Package: com.lovecoding.day10.oop02this
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/6/18 9:54
+ * @Version 1.0
+ */
+public class TestStudent {
+
+    public static void main(String[] args) {
+
+        Student student = new Student();
+
+        System.out.println(student);
+
+    }
+}

+ 39 - 0
01-JavaSe/day10/src/com/lovecoding/day10/oopex01/Account.java

@@ -0,0 +1,39 @@
+package com.lovecoding.day10.oopex01;
+
+/**
+ * ClassName: Account
+ * Package: com.lovecoding.day10.oopex01
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/6/18 10:29
+ * @Version 1.0
+ */
+public class Account {
+    private double balance;
+
+    public Account(double balance) {
+        this.balance = balance;
+    }
+
+    public Account() {
+    }
+
+    public void deposit( double m ){
+        balance+=m;
+    }
+
+    public void withdraw( double m ){
+        balance-=m;
+    }
+
+
+
+    public double getBalance() {
+        return balance;
+    }
+
+    public void setBalance(double balance) {
+        this.balance = balance;
+    }
+}

+ 37 - 0
01-JavaSe/day10/src/com/lovecoding/day10/oopex01/Bank.java

@@ -0,0 +1,37 @@
+package com.lovecoding.day10.oopex01;
+
+/**
+ * ClassName: Bank
+ * Package: com.lovecoding.day10.oopex01
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/6/18 10:33
+ * @Version 1.0
+ */
+public class Bank {
+
+    private Customer[] customers;
+
+    private int numberCustomer;
+
+    public Bank() {
+        customers = new Customer[10];
+    }
+
+    public void addCustomer( String f , String  l  ){
+        Customer customer = new Customer(f,l ,null);
+        customers[numberCustomer]=customer;
+        numberCustomer++;
+    }
+
+
+    public int getNumOfCustomers(  ){
+        return numberCustomer;
+    }
+
+    public Customer getCustomer( int index ){
+        return customers[index];
+    }
+
+}

+ 58 - 0
01-JavaSe/day10/src/com/lovecoding/day10/oopex01/Customer.java

@@ -0,0 +1,58 @@
+package com.lovecoding.day10.oopex01;
+
+/**
+ * ClassName: Customer
+ * Package: com.lovecoding.day10.oopex01
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/6/18 10:32
+ * @Version 1.0
+ */
+public class Customer {
+    private String firstName;
+    private String lastName;
+    private Account account;
+
+    public Customer(String firstName, String lastName, Account account) {
+        this.firstName = firstName;
+        this.lastName = lastName;
+        this.account = account;
+    }
+
+    public Customer() {
+    }
+
+    public String getFirstName() {
+        return firstName;
+    }
+
+    public void setFirstName(String firstName) {
+        this.firstName = firstName;
+    }
+
+    public String getLastName() {
+        return lastName;
+    }
+
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+
+    public Account getAccount() {
+        return account;
+    }
+
+    public void setAccount(Account account) {
+        this.account = account;
+    }
+
+    @Override
+    public String toString() {
+        return "Customer{" +
+                "firstName='" + firstName + '\'' +
+                ", lastName='" + lastName + '\'' +
+                ", account=" + account +
+                '}';
+    }
+}

+ 31 - 0
01-JavaSe/day10/src/com/lovecoding/day10/oopex01/TestBank.java

@@ -0,0 +1,31 @@
+package com.lovecoding.day10.oopex01;
+
+/**
+ * ClassName: TestBank
+ * Package: com.lovecoding.day10.oopex01
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/6/18 10:39
+ * @Version 1.0
+ */
+public class TestBank {
+
+    public static void main(String[] args) {
+
+        Bank bank = new Bank();
+
+        bank.addCustomer( "百里","罗云1" );
+        bank.addCustomer( "百里","罗云2" );
+        bank.addCustomer( "百里","罗云3" );
+
+        int numOfCustomers = bank.getNumOfCustomers();
+        System.out.println(numOfCustomers);
+
+        Customer customer = bank.getCustomer(1);
+
+        System.out.println(customer);
+
+
+    }
+}

binární
01-JavaSe/out/production/day10/com/lovecoding/day10/oop01this/Person.class


binární
01-JavaSe/out/production/day10/com/lovecoding/day10/oop01this/TestOopThis.class


binární
01-JavaSe/out/production/day10/com/lovecoding/day10/oop02this/Student.class


binární
01-JavaSe/out/production/day10/com/lovecoding/day10/oop02this/TestStudent.class


binární
01-JavaSe/out/production/day10/com/lovecoding/day10/oopex01/Account.class


binární
01-JavaSe/out/production/day10/com/lovecoding/day10/oopex01/Bank.class


binární
01-JavaSe/out/production/day10/com/lovecoding/day10/oopex01/Customer.class


binární
01-JavaSe/out/production/day10/com/lovecoding/day10/oopex01/TestBank.class