Poor Man's Type Classes
|
|
|
- Magnus Whitehead
- 10 years ago
- Views:
Transcription
1 Poor Man's Type Classes Martin Odersky EPFL IFIP WG2.8 workin roup meetin Boston, July
2 Goals Type classes are nice. A cottae industry of Haskell prorammers has sprun up around them. Should we add type classes to OO-lanuaes, specically Scala? Problem: Conceptual expense We have already spent the keywords type and class! Type classes are essentially implicitly passed dictionaries, and dictionaries are essentially objects. Don't want to duplicate that. Idea: Concentrate on the delta between OO classes and type classes: implicits 2
3 Life without Type Classes Some standard classes for SemiGroup and Monoid: abstract class SemiGroup[a] f def add(x: a, y: a): a abstract class Monoid[a] extends SemiGroup[a] f def unit: a Two implementations of monoids: object strinmonoid extends Monoid[Strin] f def add(x: Strin, y: Strin): Strin = x.concat(y) def unit: Strin = "" object intmonoid extends Monoid[int] f def add(x: Int, y: Int): Int = x + y def unit: Int = 0 3
4 A sum method which works over arbitrary monoids: def sum[a](xs: List[a])(m: Monoid[a]): a = if (xs.isempty) m.unit else m.add(xs.head, sum(xs.tail)(m) One invokes this sum method by code such as: sum(list("a", "bc", "de"))(strinmonoid) sum(list(1, 2, 3))(intMonoid) 4
5 Implicit Parameters: The Basics The followin sliht rewrite of sum introduces m as an implicit parameter. def sum[a](xs: List[a])(implicit m: Monoid[a]): a = if (xs.isempty) m.unit else m.add(xs.head, sum(xs.tail)(m)) Can combine normal and implicit parameters. However, there may only be one implicit parameter list, and it must come last. 5
6 implicit can also be used as a modier for denitions: implicit object strinmonoid extends Monoid[Strin] f def add(x: Strin, y: Strin): Strin = x.concat(y) def unit: Strin = "" implicit object intmonoid extends Monoid[int] f def add(x: Int, y: Int): Int = x + y def unit: Int = 0 Aruments to implicit parameters can be inferred: sum(list(1, 2, 3)) This expands to: sum(list(1, 2, 3))(intMonoid) 6
7 Inferrin Implicit Aruments If an arument for an implicit parameter of type T is missin, it is inferred. An arument value is eliible to be passed, if it is itself labelled implicit, it's type is compatible with T, one of the followin holds: 1. x is accessible at the point of call by a simple identier (i.e. it is dened in same scope, inherited or imported) 2. x is dened as a static value in (some superclass of) T. If several aruments are eliible, choose most specic one. If no most specic eliible arument exists, type error. 7
8 Locality A consequence of implicit arument resolution is that one can have several instance denitions of the same operation at the same types. We always pick the one which is visible at the point of call. This is an important dierence between implicits and type classes. Rules to keep coherence: Scala has functions (which are objects) and methods (which are not). Partially applied methods are automatically converted to functions. Only methods can contain implicit parameters. Implicit parameters are instantiated where a method value is eliminated (either applied or converted to a function). 8
9 Conditional Implicits Implicit methods can themselves have implicit parameters. Example: implicit def listmonoid[a](implicit m: Monoid[a]) = new Monoid[List[a]] f def add(xs: List[a], ys: List[a]): List[a] = if (xs.isempty) ys else if (ys.isempty) xs else m.add(xs.head, ys.head) :: add(xs.tail, ys.tail) def unit = List() Then: println(sum(list(list(1, 2, 3), List(1, 2)))) translates to println(sum(list(list(1, 2, 3), List(1, 2)))(listMonoid(intMonoid)) ==> List(2, 4, 3) 9
10 External Extensibility Often, we like to add some new functionality to a pre-existin type. trait Ordered[a] f def compare(that: a): Int; def < (that: a): Boolean = (this compare that) < 0 def > (that: a): Boolean = (this compare that) > 0 def (that: a): Boolean = (this compare that) 0 def (that: a): Boolean = (this compare that) 0 Want to make Int, Strin, etc ordered. Want to make lists ordered if their elements are. Common solution: \open classes". 10
11 Implicit Conversions An implicit conversion is a unary function from S ot T, which is labelled implicit. Example: implicit def int2ordered(x: int) = new Ordered[int] f def compare(y: int) = if (x < y) 1 else if (x > y) 1 else 0 def sort[a](xs: Array[a])(implicit c: a ) Ordered[a]): Array[a] = if (xs.lenth 1) xs else f val pivot = xs(xs.lenth / 2) Array.concat( sort(xs lter (pivot >)) xs lter (pivot ==), sort(xs lter (pivot <))) val xss: Array[List[int]] sort(xss) 11
12 Translation def sort[a](xs: Array[a])(implicit c: a ) Ordered[a]): Array[a] = if (xs.lenth 1) xs else f val pivot = xs(xs.lenth / 2) Array.concat( sort(xs lter (c(pivot) >)) xs lter (pivot ==), sort(xs lter (c(pivot) <))) val xss: Array[List[int]] sort(xss)(list2ordered(int2ordered)) 12
13 Applications of Implicit Conversions An implicit conversion is applied to a term e if, e is not compatible with its expected type: val x: Ordered[int] = 1 ==> val x: Ordered[int] = int2ordered(1) In a selection e:m, if e does not have a member m. x.<(1) ==> int2ordered(x).<(1) In an application e:m(a1; : : : ; an), if e does not have a member m which can be applied to (a1; : : : ; an): val x = BiInt(10); 1 + x ==> BiInt(1) + x 13
14 Summary Scala implements the followin analoies: type class = class instance declaration = implicit denition context in a clas = inheritance context in a type = implicit parameter dictionary = object default method in class = concrete member method sinature in class = abstract member 14
15 Conclusion Implicit parameters are poor man's type classes. Conceptually lihtweiht. Piy-backed on object system. Implemented in Scala version 2, Can also model + multi-parameter type classes + parametric type classes (but no eneral functional dependencies). + associated types + constructor classes (via encodins, make this convenient we should add hiher-kinded type variables) 15
Overview. Elements of Programming Languages. Advanced constructs. Motivating inner class example
Overview Elements of Programming Languages Lecture 12: Object-oriented functional programming James Cheney University of Edinburgh November 6, 2015 We ve now covered: basics of functional and imperative
CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.
CSCI 253 Object Oriented Design: Java Review OOP George Blankenship George Blankenship 1 Object Oriented Programming (OOP) OO Principles Abstraction Encapsulation Abstract Data Type (ADT) Implementation
Programming Language Rankings. Lecture 15: Type Inference, polymorphism & Type Classes. Top Combined. Tiobe Index. CSC 131! Fall, 2014!
Programming Language Rankings Lecture 15: Type Inference, polymorphism & Type Classes CSC 131 Fall, 2014 Kim Bruce Top Combined Tiobe Index 1. JavaScript (+1) 2. Java (-1) 3. PHP 4. C# (+2) 5. Python (-1)
Analyse et Conception Formelle. Lesson 5. Crash Course on Scala
Analyse et Conception Formelle Lesson 5 Crash Course on Scala T. Genet (ISTIC/IRISA) ACF-5 1 / 36 Bibliography Simply Scala. Online tutorial: http://www.simply.com/fr http://www.simply.com/ Programming
Tutorial on Writing Modular Programs in Scala
Tutorial on Writing Modular Programs in Scala Martin Odersky and Gilles Dubochet 13 September 2006 Tutorial on Writing Modular Programs in Scala Martin Odersky and Gilles Dubochet 1 of 45 Welcome to the
Scala Programming Language
Scala Programming Language Tomáš Bureš DISTRIBUTED SYSTEMS RESEARCH GROUP http://nenya.ms.mff.cuni.cz CHARLES UNIVERSITY PRAGUE Faculty of Mathematics and Physics What is Scala Programming language class-based
Java Programming Language
Lecture 1 Part II Java Programming Language Additional Features and Constructs Topics in Quantitative Finance: Numerical Solutions of Partial Differential Equations Instructor: Iraj Kani Subclasses and
Type Classes with Functional Dependencies
Appears in Proceedings of the 9th European Symposium on Programming, ESOP 2000, Berlin, Germany, March 2000, Springer-Verlag LNCS 1782. Type Classes with Functional Dependencies Mark P. Jones Department
Managing large sound databases using Mpeg7
Max Jacob 1 1 Institut de Recherche et Coordination Acoustique/Musique (IRCAM), place Igor Stravinsky 1, 75003, Paris, France Correspondence should be addressed to Max Jacob ([email protected]) ABSTRACT
A Scala Tutorial for Java programmers
A Scala Tutorial for Java programmers Version 1.3 January 16, 2014 Michel Schinz, Philipp Haller PROGRAMMING METHODS LABORATORY EPFL SWITZERLAND 2 1 Introduction This document gives a quick introduction
Java Interview Questions and Answers
1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java
Introduction Object-Oriented Network Programming CORBA addresses two challenges of developing distributed systems: 1. Making distributed application development no more dicult than developing centralized
Datatype-generic data migrations
Datatype-generic data migrations IFIP WG 21 meeting #73, Lökeberg, Sweden Andres Löh August 31, 2015 The Haskell Consultants Motivation Datatypes evolve Motivation Datatypes evolve Example: data Person
Glossary of Object Oriented Terms
Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction
CSc 372. Comparative Programming Languages. 21 : Haskell Accumulative Recursion. Department of Computer Science University of Arizona
1/18 CSc 372 Comparative Programming Languages 21 : Haskell Accumulative Recursion Department of Computer Science University of Arizona [email protected] Copyright c 2013 Christian Collberg 2/18 Stack
PHP Object Oriented Classes and objects
Web Development II Department of Software and Computing Systems PHP Object Oriented Classes and objects Sergio Luján Mora Jaume Aragonés Ferrero Department of Software and Computing Systems DLSI - Universidad
POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful
POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful RALF HINZE Institute of Information and Computing Sciences Utrecht University Email: [email protected] Homepage: http://www.cs.uu.nl/~ralf/
Computing Concepts with Java Essentials
2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Computing Concepts with Java Essentials 3rd Edition Cay Horstmann
Getting Started with the Internet Communications Engine
Getting Started with the Internet Communications Engine David Vriezen April 7, 2014 Contents 1 Introduction 2 2 About Ice 2 2.1 Proxies................................. 2 3 Setting Up ICE 2 4 Slices 2
Formal Engineering for Industrial Software Development
Shaoying Liu Formal Engineering for Industrial Software Development Using the SOFL Method With 90 Figures and 30 Tables Springer Contents Introduction 1 1.1 Software Life Cycle... 2 1.2 The Problem 4 1.3
CS1002: COMPUTER SCIENCE OO MODELLING & DESIGN: WEEK 5
This Week CS1002: COMPUTER SCIENCE OO MODELLING & DESIGN: WEEK 5 School of Computer Science University of St Andrews Graham Kirby Alan Dearle More on Java classes Constructors Modifiers cdn.videogum.com/img/thumbnails/photos/commenter.jpg
13 Classes & Objects with Constructors/Destructors
13 Classes & Objects with Constructors/Destructors 13.1 Introduction In object oriented programming, the emphasis is on data rather than function. Class is a way that binds the data & function together.
Aspect-Oriented Programming with Type Classes
Aspect-Oriented Programming with Type Classes Martin Sulzmann School of Computing, National University of Singapore S16 Level 5, 3 Science Drive 2, Singapore 117543 [email protected] Meng Wang School
types, but key declarations and constraints Similar CREATE X commands for other schema ëdrop X name" deletes the created element of beer VARCHARè20è,
Dening a Database Schema CREATE TABLE name èlist of elementsè. Principal elements are attributes and their types, but key declarations and constraints also appear. Similar CREATE X commands for other schema
Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas
CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage
Description of Class Mutation Mutation Operators for Java
Description of Class Mutation Mutation Operators for Java Yu-Seung Ma Electronics and Telecommunications Research Institute, Korea [email protected] Jeff Offutt Software Engineering George Mason University
Scala type classes and machine learning. David Andrzejewski Bay Area Scala Enthusiasts - 1/14/2013, 1/16/2013
Scala type classes and machine learning David Andrzejewski Bay Area Scala Enthusiasts - 1/14/2013, 1/16/2013 Context: Sumo Logic Mission: Transform Machine Data into IT and Business Insights Offering:
History OOP languages Year Language 1967 Simula-67 1983 Smalltalk
History OOP languages Intro 1 Year Language reported dates vary for some languages... design Vs delievered 1957 Fortran High level programming language 1958 Lisp 1959 Cobol 1960 Algol Structured Programming
Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.
Handout 1 CS603 Object-Oriented Programming Fall 15 Page 1 of 11 Handout 1 Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Java
Checking Access to Protected Members in the Java Virtual Machine
Checking Access to Protected Members in the Java Virtual Machine Alessandro Coglio Kestrel Institute 3260 Hillview Avenue, Palo Alto, CA 94304, USA Ph. +1-650-493-6871 Fax +1-650-424-1807 http://www.kestrel.edu/
JAVA - INHERITANCE. extends is the keyword used to inherit the properties of a class. Below given is the syntax of extends keyword.
http://www.tutorialspoint.com/java/java_inheritance.htm JAVA - INHERITANCE Copyright tutorialspoint.com Inheritance can be defined as the process where one class acquires the properties methodsandfields
Semester Review. CSC 301, Fall 2015
Semester Review CSC 301, Fall 2015 Programming Language Classes There are many different programming language classes, but four classes or paradigms stand out:! Imperative Languages! assignment and iteration!
The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1
The Java Series Java Essentials I What is Java? Basic Language Constructs Slide 1 What is Java? A general purpose Object Oriented programming language. Created by Sun Microsystems. It s a general purpose
Reactive Slick for Database Programming. Stefan Zeiger
Reactive Slick for Database Programming Stefan Zeiger Introduction Slick 3.0 Reactive Slick Completely new API for executing database actions Old API (Invoker, Executor) deprecated Will be removed in 3.1
Agile Software Development
Agile Software Development Lecturer: Raman Ramsin Lecture 13 Refactoring Part 3 1 Dealing with Generalization: Pull Up Constructor Body Pull Up Constructor Body You have constructors on subclasses with
Searching Algorithms
Searching Algorithms The Search Problem Problem Statement: Given a set of data e.g., int [] arr = {10, 2, 7, 9, 7, 4}; and a particular value, e.g., int val = 7; Find the first index of the value in the
Detecting Pattern-Match Failures in Haskell. Neil Mitchell and Colin Runciman York University www.cs.york.ac.uk/~ndm/catch
Detecting Pattern-Match Failures in Haskell Neil Mitchell and Colin Runciman York University www.cs.york.ac.uk/~ndm/catch Does this code crash? risers [] = [] risers [x] = [[x]] risers (x:y:etc) = if x
Java Interfaces. Recall: A List Interface. Another Java Interface Example. Interface Notes. Why an interface construct? Interfaces & Java Types
Interfaces & Java Types Lecture 10 CS211 Fall 2005 Java Interfaces So far, we have mostly talked about interfaces informally, in the English sense of the word An interface describes how a client interacts
Java CPD (I) Frans Coenen Department of Computer Science
Java CPD (I) Frans Coenen Department of Computer Science Content Session 1, 12:45-14:30 (First Java Programme, Inheritance, Arithmetic) Session 2, 14:45-16:45 (Input and Programme Constructs) Materials
Chapter 6: Programming Languages
Chapter 6: Programming Languages Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear Copyright 2012 Pearson Education, Inc. Chapter 6: Programming Languages 6.1 Historical Perspective
An Introduction To UML Class Diagrams Classes
An Introduction To UML Class Diagrams Classes 1. Represent a user-created or defined data type a. they are an abstract data type (ADT) b. they implement data hiding and encapsulation c. they establish
Introduction to Object-Oriented Programming
Introduction to Object-Oriented Programming Programs and Methods Christopher Simpkins [email protected] CS 1331 (Georgia Tech) Programs and Methods 1 / 8 The Anatomy of a Java Program It is customary
www.sahajsolns.com Chapter 4 OOPS WITH C++ Sahaj Computer Solutions
Chapter 4 OOPS WITH C++ Sahaj Computer Solutions 1 Session Objectives Classes and Objects Class Declaration Class Members Data Constructors Destructors Member Functions Class Member Visibility Private,
Fundamentals of Java Programming
Fundamentals of Java Programming This document is exclusive property of Cisco Systems, Inc. Permission is granted to print and copy this document for non-commercial distribution and exclusive use by instructors
AP Computer Science Java Subset
APPENDIX A AP Computer Science Java Subset The AP Java subset is intended to outline the features of Java that may appear on the AP Computer Science A Exam. The AP Java subset is NOT intended as an overall
Chapter 13 - Inheritance
Goals Chapter 13 - Inheritance To learn about inheritance To understand how to inherit and override superclass methods To be able to invoke superclass constructors To learn about protected and package
Part I. Multiple Choice Questions (2 points each):
Part I. Multiple Choice Questions (2 points each): 1. Which of the following is NOT a key component of object oriented programming? (a) Inheritance (b) Encapsulation (c) Polymorphism (d) Parallelism ******
Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is
Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is preceded by an equal sign d. its name has undereline 2. Associations
The Clean programming language. Group 25, Jingui Li, Daren Tuzi
The Clean programming language Group 25, Jingui Li, Daren Tuzi The Clean programming language Overview The Clean programming language first appeared in 1987 and is still being further developed. It was
How Scala Improved Our Java
How Scala Improved Our Java Sam Reid PhET Interactive Simulations University of Colorado http://spot.colorado.edu/~reids/ PhET Interactive Simulations Provides free, open source educational science simulations
Visual Basic Programming. An Introduction
Visual Basic Programming An Introduction Why Visual Basic? Programming for the Windows User Interface is extremely complicated. Other Graphical User Interfaces (GUI) are no better. Visual Basic provides
CS 111 Classes I 1. Software Organization View to this point:
CS 111 Classes I 1 Software Organization View to this point: Data Objects and primitive types Primitive types operators (+, /,,*, %). int, float, double, char, boolean Memory location holds the data Objects
Dynamic conguration management in a graph-oriented Distributed Programming Environment
Science of Computer Programming 48 (2003) 43 65 www.elsevier.com/locate/scico Dynamic conguration management in a graph-oriented Distributed Programming Environment Jiannong Cao a;, Alvin Chan a, Yudong
Design by Contract beyond class modelling
Design by Contract beyond class modelling Introduction Design by Contract (DbC) or Programming by Contract is an approach to designing software. It says that designers should define precise and verifiable
In the above, the number 19 is an example of a number because its only positive factors are one and itself.
Math 100 Greatest Common Factor and Factoring by Grouping (Review) Factoring Definition: A factor is a number, variable, monomial, or polynomial which is multiplied by another number, variable, monomial,
The Sun Certified Associate for the Java Platform, Standard Edition, Exam Version 1.0
The following applies to all exams: Once exam vouchers are purchased you have up to one year from the date of purchase to use it. Each voucher is valid for one exam and may only be used at an Authorized
D06 PROGRAMMING with JAVA
Cicles Formatius de Grau Superior Desenvolupament d Aplicacions Informàtiques D06 PROGRAMMING with JAVA Ch13 Inheritance PowerPoint presentation, created by Angel A. Juan - ajuanp(@)gmail.com, for accompanying
CS193j, Stanford Handout #10 OOP 3
CS193j, Stanford Handout #10 Summer, 2003 Manu Kumar OOP 3 Abstract Superclass Factor Common Code Up Several related classes with overlapping code Factor common code up into a common superclass Examples
Anatomy of Programming Languages. William R. Cook
Anatomy of Programming Languages William R. Cook Copyright (C) 2013 2 Chapter 1 Preliminaries Preface What? This document is a series of notes about programming languages, originally written for students
Chapter 5 Names, Bindings, Type Checking, and Scopes
Chapter 5 Names, Bindings, Type Checking, and Scopes Chapter 5 Topics Introduction Names Variables The Concept of Binding Type Checking Strong Typing Scope Scope and Lifetime Referencing Environments Named
Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program
Free Java textbook available online "Thinking in Java" by Bruce Eckel, 4th edition, 2006, ISBN 0131872486, Pearson Education Introduction to the Java programming language CS 4354 Summer II 2015 The third
SE 360 Advances in Software Development Object Oriented Development in Java. Polymorphism. Dr. Senem Kumova Metin
SE 360 Advances in Software Development Object Oriented Development in Java Polymorphism Dr. Senem Kumova Metin Modified lecture notes of Dr. Hüseyin Akcan Inheritance Object oriented programming languages
Object oriented design process
Unit IV Design Object oriented design process 1.Apply design axioms to design classes 1.1 Refine and complete the static UML class diagram 1.2 Iterate and refine again 2. Design the access layer 2.1 create
Type Classes as Objects and Implicits
Type Classes as Objects and Implicits Bruno C. d. S. Oliveira ROSAEC Center, Seoul National University [email protected] Adriaan Moors Martin Odersky EPFL {adriaan.moors, [email protected] Abstract
Lecture 12: Abstract data types
Lecture 12: Abstract data types Algebras Abstract data types Encapsulation and information hiding Parameterization Algebras Definition Which kinds of data do we want to discuss? What can we do with it?
Big Data Frameworks: Scala and Spark Tutorial
Big Data Frameworks: Scala and Spark Tutorial 13.03.2015 Eemil Lagerspetz, Ella Peltonen Professor Sasu Tarkoma These slides: http://is.gd/bigdatascala www.cs.helsinki.fi Functional Programming Functional
Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program
Free Java textbook available online "Thinking in Java" by Bruce Eckel, 4th edition, 2006, ISBN 0131872486, Pearson Education Introduction to the Java programming language CS 4354 Summer II 2014 Jill Seaman
Programming Languages Featherweight Java David Walker
Programming Languages Featherweight Java David Walker Overview Featherweight Java (FJ), a minimal Javalike language. Models inheritance and subtyping. Immutable objects: no mutation of fields. Trivialized
Chapter 7: Functional Programming Languages
Chapter 7: Functional Programming Languages Aarne Ranta Slides for the book Implementing Programming Languages. An Introduction to Compilers and Interpreters, College Publications, 2012. Fun: a language
Statements and Control Flow
Contents 1. Introduction 2. Types and Variables 3. Statements and Control Flow 4. Reading Input 5. Classes and Objects 6. Arrays 7. Methods 8. Scope and Lifetime 9. Utility classes 10. Introduction to
A Typing System for an Optimizing Multiple-Backend Tcl Compiler
The following paper was originally published in the Proceedings of the Fifth Annual Tcl/Tk Workshop Boston, Massachusetts, July 1997 A Typing System for an Optimizing Multiple-Backend Tcl Compiler Forest
S4 Classes in 15 pages, more or less
S4 Classes in 15 pages, more or less February 12, 2003 Overview The preferred mechanism for object oriented programming in R is described in Chambers (1998). The actual implementation is slightly different
The Needle Programming Language
The Needle Programming Language The Needle Programming Language 1 What is Needle? Needle is an object-oriented functional programming language with a multimethod-based OO system, and a static type system
Independently Extensible Solutions to the Expression Problem
Independently Extensible Solutions to the Expression Problem Matthias Zenger, Martin Odersky École Polytechnique Fédérale de Lausanne INR Ecublens 1015 Lausanne, Switzerland Technical Report IC/2004/33
J a v a Quiz (Unit 3, Test 0 Practice)
Computer Science S-111a: Intensive Introduction to Computer Science Using Java Handout #11 Your Name Teaching Fellow J a v a Quiz (Unit 3, Test 0 Practice) Multiple-choice questions are worth 2 points
Polymorphism. Problems with switch statement. Solution - use virtual functions (polymorphism) Polymorphism
Polymorphism Problems with switch statement Programmer may forget to test all possible cases in a switch. Tracking this down can be time consuming and error prone Solution - use virtual functions (polymorphism)
An Algebra for Feature-Oriented Software Development
An Algebra for Feature-Oriented Software Development Sven Apel 1, Christian Lengauer 1, Don Batory 2, Bernhard Möller 3, and Christian Kästner 4 1 Department of Informatics and Mathematics, University
Abstract Class & Java Interface
Abstract Class & Java Interface 1 Agenda What is an Abstract method and an Abstract class? What is Interface? Why Interface? Interface as a Type Interface vs. Class Defining an Interface Implementing an
5. Advanced Object-Oriented Programming Language-Oriented Programming
5. Advanced Object-Oriented Programming Language-Oriented Programming Prof. Dr. Bernhard Humm Faculty of Computer Science Hochschule Darmstadt University of Applied Sciences 1 Retrospective Functional
INTRODUCTION TO OBJECTIVE-C CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 12 09/29/2011
INTRODUCTION TO OBJECTIVE-C CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 12 09/29/2011 1 Goals of the Lecture Present an introduction to Objective-C 2.0 Coverage of the language will be INCOMPLETE
PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?
1. Distinguish & and && operators. PART-A Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members
Problem 1. CS 61b Summer 2005 Homework #2 Due July 5th at the beginning of class
CS 61b Summer 2005 Homework #2 Due July 5th at the beginning of class This homework is to be done individually. You may, of course, ask your fellow classmates for help if you have trouble editing files,
How To Write A Program In Java (Programming) On A Microsoft Macbook Or Ipad (For Pc) Or Ipa (For Mac) (For Microsoft) (Programmer) (Or Mac) Or Macbook (For
Projet Java Responsables: Ocan Sankur, Guillaume Scerri (LSV, ENS Cachan) Objectives - Apprendre à programmer en Java - Travailler à plusieurs sur un gros projet qui a plusieurs aspects: graphisme, interface
Outline of this lecture G52CON: Concepts of Concurrency
Outline of this lecture G52CON: Concepts of Concurrency Lecture 10 Synchronisation in Java Natasha Alechina School of Computer Science [email protected] mutual exclusion in Java condition synchronisation
PRI-(BASIC2) Preliminary Reference Information Mod date 3. Jun. 2015
PRI-(BASIC2) Table of content Introduction...2 New Comment...2 Long variable...2 Function definition...3 Function declaration...3 Function return value...3 Keyword return inside functions...4 Function
OpenCL Static C++ Kernel Language Extension
OpenCL Static C++ Kernel Language Extension Document Revision: 04 Advanced Micro Devices Authors: Ofer Rosenberg, Benedict R. Gaster, Bixia Zheng, Irina Lipov December 15, 2011 Contents 1 Overview... 3
Stack Allocation. Run-Time Data Structures. Static Structures
Run-Time Data Structures Stack Allocation Static Structures For static structures, a fixed address is used throughout execution. This is the oldest and simplest memory organization. In current compilers,
Business Application
137 Germain CRT Validation Rules for Siebel CRM 7.7,7.8,8.0,8.1,8.2 Validation Rule Name Validation Rule Description Business Application Siebel Repository Level Improve CPU Improve Memory GS-SBL-REP-JDBC-1001
Preet raj Core Java and Databases CS4PR. Time Allotted: 3 Hours. Final Exam: Total Possible Points 75
Preet raj Core Java and Databases CS4PR Time Allotted: 3 Hours Final Exam: Total Possible Points 75 Q1. What is difference between overloading and overriding? 10 points a) In overloading, there is a relationship
Designware: This paper presents a mechanizable framework for software development by renement.
Designware: Software Development by Renement Douglas R. Smith Kestrel Institute, Palo Alto, California 94304 USA Abstract This paper presents a mechanizable framework for software development by renement.
Data-cubing made-simple! with Spark, Algebird and HBase goo.gl/dbgr0h
Data-cubing made-simple! with Spark, Algebird and HBase goo.gl/dbgr0h Vidmantas Zemleris Agenda Intro Analytics at Vinted What is Data-cubing? Why did we build it? Architecture Preliminaries Metric computation
PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON
PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London
