A brief introduction to 11ACM 朱旻申. Outline What is Groovy ? Differences between Groovy & Java About closure & Dagger Methods.

Slides:



Advertisements
Similar presentations
Data Structures Static and Dynamic.
Advertisements

Introduction to Recursion and Recursive Algorithms
Recursion vs. Iteration The original Lisp language was truly a functional language: –Everything was expressed as functions –No local variables –No iteration.
Object Orientation Chapter SixteenModern Programming Languages, 2nd ed.1 Spring 2012.
Object Orientation Chapter SixteenModern Programming Languages, 2nd ed.1.
Portability and Safety Mahdi Milani Fard Dec, 2006 Java.
Java Basic Training HaiNH - FQA. Agenda Introduction to Java Java Programming Environment Language Fundamental Object Oriented Programming with Java.
Snejina Lazarova Senior QA Engineer, Team Lead CRMTeam Dimo Mitev Senior QA Engineer, Team Lead SystemIntegrationTeam Telerik QA Academy SOAP-based Web.
Language of the Month If it’s December, it must be Ruby! Adam Coffman and Brent Beer.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
CSE 341, Winter Type Systems Terms to learn about types: –Type –Type system –Statically typed language –Dynamically typed language –Type error –Strongly.
CS 4800 By Brandon Andrews.  Specifications  Goals  Applications  Design Steps  Testing.
CIS 101: Computer Programming and Problem Solving Lecture 8 Usman Roshan Department of Computer Science NJIT.
Principles of Object-Oriented Software Development The language Java.
Data Structures Introduction. What is data? (Latin) Plural of datum = something given.
Programming in Scala Chapter 1. Scala: both object-oriented and functional Scala blends –object-oriented and –functional programming in a –statically.
CS102--Object Oriented Programming Review 1: Chapter 1 – Chapter 7 Copyright © 2008 Xiaoyan Li.
CMSC 341 Introduction to Java Based on tutorial by Rebecca Hasti at
Groovy WHAT IS IT? HOW DOES IT WORK? IS IT USEFUL?
Programming Languages and Paradigms Object-Oriented Programming.
A TOUR OF RUBY 2011 ACM Class, Dong Xie. What is Ruby?  Dynamic programming language  Complex but expressive grammar  A core class library with rich.
Advanced Java Programming Lecture 5 Reflection dr hab. Szymon Grabowski dr inż. Wojciech Bieniecki
Java Virtual Machine Java Virtual Machine A Java Virtual Machine (JVM) is a set of computer software programs and data structures that use.
Implement High-level Program Language on JVM CSCE 531 ZHONGHAO LIU ZHONGHAO LIU XIAO LIN.
CS162 Week 1 Kyle Dewey. Overview Basic Introduction CS Accounts Scala survival guide.
Static and Dynamic Behavior CMPS Power of OOP Derives from the ability of objects to change their behavior dynamically at run time. Static – refers.
Introduction to 12/13/20111 Prepared by: Vincent Schwarzer, Chih-Hung Hsieh Java Enterprise Application Development.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
The Daikon system for dynamic detection of likely invariants MIT Computer Science and Artificial Intelligence Lab. 16 January 2007 Presented by Chervet.
OOP and Dynamic Method Binding Chapter 9. Object Oriented Programming Skipping most of this chapter Focus on 9.4, Dynamic method binding – Polymorphism.
CS162 Week 1 Kyle Dewey. Overview Basic Introduction CS Accounts Scala survival guide.
SOAP-based Web Services Telerik Software Academy Software Quality Assurance.
CS162 Week 1 Kyle Dewey. Overview Basic Introduction CS Accounts Scala survival guide.
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
RUBY by Ryan Chase.
Software Development Introduction
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
20-Feb-16 javap. Bytecode Java is compiled into bytecode, which is intermediate between Java and a “real” assembly language To implement Java, it is only.
Polymorphism and Virtual Functions One name many shapes behaviour Unit - 07.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
CSCI-383 Object-Oriented Programming & Design Lecture 17.
Memory Management in Java Mr. Gerb Computer Science 4.
Java and C# - Some Commonalities Compile into machine-independent, language- independent code which runs in a managed execution environment Garbage Collection.
CSCE 343 – Programming Language Concepts Welcome!.
CodeBeamer Bootcamp 2007 Customizing CodeBeamer features through scripting Aron Gombas Architect, Intland.
Chapter 1. Introduction.
COMP 2100 From Python to Java
Lecture 16: Introduction to Data Types
Concepts of programming languages
Type Systems Terms to learn about types: Related concepts: Type
Mobile Development Workshop
Final Review In Text: Chapters 1-3, 5-11,
Final Review In Text: Chapters 1-11,
Final Review In Text: Chapters 1-3, 5-10, 12,
Final Review In Text: Chapters 1-3, 5-10, 12,
Final Review In Text: Chapters 1-3, 5-10,
Final Review In Text: Chapters 1-3, 5-10,
Midterm Review In Text: Chapters 1-3, 5-10, 15.
Sridhar Narayan Java Basics Sridhar Narayan
Final Review In Text: Chapters 1-3, 5-12,
Final Review In Text: Chapters 1-3, 5-16.
Final Review In Text: Chapters 1-3, 5-16.
Type Systems Terms to learn: Type Type system
Final Review In Text: Chapters 1-3, 5-16.
Type Systems Terms to learn about types: Related concepts: Type
Groovy.
Midterm Review In Text: Chapters 1-3, 5-11, 15.
CSc 453 Interpreters & Interpretation
Presentation transcript:

A brief introduction to 11ACM 朱旻申

Outline What is Groovy ? Differences between Groovy & Java About closure & Dagger Methods

Groovy … An agile and dynamic language for the Java Virtual Machine Builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby and Smalltalk Provides the ability to statically type check and statically compile your code

An Example In Groovy : In Java :

Grammar vs Java No “;”, “()” & “public” No constructor, no “return” No types, everything is an object Closure

Grammar Java without types

Grammar Loop

Grammar Use “?” to avoid NULL pointer call

Closure Codes in “{}”

Closure in iteration

Dagger Methods Short, small but efficient Mostly implemented by closure

eachWithIndex Running results : 1 : a 2 : b 3 : c

any & every Running results : true false

grep [‘a’, ‘ab’] [‘ab’]

sort Running results : 7, 23, 2012

References Wikipedia 百度文库