zoukankan      html  css  js  c++  java
  • Groovy

    https://en.wikipedia.org/wiki/Groovy_(programming_language)

    Groovy offers simple, consistent syntax for handling lists and maps, reminiscent of Java's array syntax.[19]

     
    def movieList = ['Dersu Uzala', 'Ran', 'Seven Samurai']  // Looks like an array, but is a list
    assert movieList[2] == 'Seven Samurai'
    movieList[3] = 'Casablanca'  // Adds an element to the list
    assert movieList.size() == 4
    
    def monthMap = [ 'January' : 31, 'February' : 28, 'March' : 31 ]  // Declares a map
    assert monthMap['March'] == 31  // Accesses an entry
    monthMap['April'] = 30  // Adds an entry to the map
    assert monthMap.size() == 4
    

      

  • 相关阅读:
    排座椅
    关于math.h的问题
    客户调查
    排队打水
    删数游戏
    小数背包
    零件分组
    桐桐的组合
    桐桐的数学游戏
    桐桐的全排列
  • 原文地址:https://www.cnblogs.com/rsapaper/p/7756223.html
Copyright © 2011-2022 走看看