Writelnoperateadd 23 and can be returned from

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: nc.ons have dynamic binding: Book a=new Book(...); a.shipping(); //call Book::shipping() Book b=new AudioBook(“C++”, 2010,2.5); b.shipping(); //call AudioBook::shipping() Func.on Objects •  JavaScript examples: •  Unlike func.onal languages, where function operate(operator,x,y) {return operator(x,y);} func.ons are first ­class and function add(x,y){return x+y;} can be passed as var f=add; parameters to a func.on document.writeln(operate(add, 2,3)); //? and can be returned from document.writeln(operate(f, 2,3)); //? a func.on, C++ func.ons can not be copied to an function addx(x) { func.on argument or be return function addy(y) {return x+y} returned fro...
View Full Document

This document was uploaded on 03/06/2014 for the course CS 3710 at Memorial University.

Ask a homework question - tutors are online