• 数组


    package com.aila;

    public class Ailajiang {


      public static void main(String[] args) {
        int[] arr = new int [30];
        arr[0] = 1;
        arr[1] = 1;
        for(int i = 2;i < arr.length;i++)
        arr[i] = arr[i - 1] + arr[i - 2];
        for(int i : arr)
        System.out.println(i);
      }


    }

    package com.aila;

    public class ailasang {
      public static void main(String[] args) {
        human hm[] = new human[3];
        hm[0] = new human("aila",19);
        hm[1] = new human("ailala",18);
        hm[2] = new human("ailalala",20);
        for(int i = 0;i < hm.length;i++)
        hm[i].getInfo();
      }

    }

    class human{
      private String name;
      private int age;
      public human(String name,int age) {
        this.name = name;
        this.age = age;
      }
      public void getInfo() {
      System.out.println("姓名:" + this.name + " 年龄:" + this.age);

      }
    }

    package com.aila;

    public class ailale {

      public static void main(String[] args) {
        int[] arr = {1,5,6,7,9,8,3,0,2,4};
        for(int i = 0;i < arr.length;i++) {
          for(int j = i + 1;j < arr.length;j++) {
            if(arr[i] < arr[j]) {
              int temp = arr[i];
              arr[i] = arr[j];
              arr[j] = temp;
            }
        }

      }
       for(int i : arr)
       System.out.println(i);
      }

    }

    package com.aila;

    public class ailala {
      public static void main(String[] args) {
        int[] arr = {1,5,6,7,9,8,3,0,2,4};
        for(int i = 0;i < arr.length;i++) {
          for(int j = 0;j < arr.length - 1 -i;j++) {
            if(arr[j] < arr[j + 1]) {
              int temp = arr[j];
              arr[j] = arr[j + 1];
              arr[j + 1] = temp;
            }
          }

        }
      for(int i : arr)
      System.out.println(i);
    }

    }

  • 相关阅读:
    【电子书】企业级IT运维宝典之GoldenGate实战下载
    10.Oracle Golden Date(ogg)的搭建和管理(转载)
    VMware Workstation 15 Pro 永久激活密钥
    oracle undo表空间增大不释放
    Oracle11g-BBED安装
    alter system/session set events相关知识
    DG环境的日常巡检
    nginx ----http强制跳转https
    转载:Zabbix-(五)监控Docker容器与自定义jvm监控项
    ORACLE备份保留策略(RETENTION POLICY)
  • 原文地址:https://www.cnblogs.com/TingGeGe/p/8057574.html
Copyright © 2020-2023  润新知