• 答案(1)


    1)select Fclass, max(Fscore) from table group by Fclass, Fid;

    2)单例模式

     1 public class Singleton{
     2   /* 懒汉式 */
     3   private static Singleton instance = new Singleton();
     4   
     5   private Singleton(){}
     6   
     7   public static Singleton getInstance(){
     8     return instance;
     9   }
    10 }
    11 
    12 public class Singleton{
    13   /* 饿汉式 */
    14   private static Singleton instance = null;
    15   
    16   private Singleton(){}
    17   
    18   public static Singleton getInstance(){
    19     if(instance == null)
    20         instance = new Singleton();
    21     return instance;
    22   }
    23 }
    Code

     3)冒泡排序

     1 public void BubbleSort(int[] a, int n){
     2   boolean change = true;
     3   for(int i = 1; i < n && change; i++){
     4     change = false;
     5     for(int j = 0; j < n - i; j++){
     6       if(a[j] > a[j + 1]){
     7         int t = a[j];
     8         a[j] = a[j + 1];
     9         a[j + 1] = t;
    10         change = true;
    11       }
    12     }
    13   }
    14 }
    Code

     4)DOM、SAX、JDOM、DOM4J

     1 public class HrReader {
     2   public void readXml() {
     3     String inputXml = "E:/hr.xml";
     4     SAXReader saxReader = new SAXReader();
     5       try {
     6         Document document = saxReader.read(inputXml);
     7         Element root = document.getRootElement();
     8         List<Element> employees = root.elements("employee");
     9           for (Element employee : employees) {
    10             Attribute att = employee.attribute("no");
    11             System.out.print(att.getText() + " ");
    12             
    13             System.out.print(employee.elementText("name") + " ");
    14             System.out.print(employee.elementText("age") + " ");
    15             System.out.print(employee.elementText("salary") + " ");
    16             
    17             Element department = employee.element("department");
    18             System.out.print(department.element("dname").getText() + " ");
    19             System.out.println(department.element("address").getText());
    20           }
    21       } catch (DocumentException e) {
    22           e.printStackTrace();
    23         }
    24   }
    25 
    26   public static void main(String[] args) {
    27     HrReader hrReader = new HrReader();
    28     hrReader.readXml();
    29   }
    30 }
    Code
  • 相关阅读:
    动画效果
    iOS蓝牙4.0
    讯飞语音接口使用
    Xcode添加注释
    CocoaPods安装
    mac os 下打开FTP服务器
    画面渲染:实时渲染(Real-time Rendering)、离线渲染(Offline Rendering)[转]
    Unity3D笔记 英保通九 创建数
    Unity3D笔记 英保通八 关节、 布料、粒子系统
    Unity3D 记第二次面试
  • 原文地址:https://www.cnblogs.com/sketeton/p/11760816.html
Copyright © 2020-2023  润新知