Objective-C. Smalltalk C++ Objective-C. Java C#

Size: px
Start display at page:

Download "Objective-C. Smalltalk C++ Objective-C. Java C#"

Transcription

1 Objective-C

2 Objective-C Smalltalk C Objective-C C++ Java C# Strict superset of C o You can mix C with Objective-C o Can even mix C++ with Objective-C (usually referred to as Objective-C++) Language is relatively simple compared to C++, but does introduce some new syntax

3 Similarities to C/C++ Most primitive data types Variable declaration and initialization Assignment statements and arithmetic Conditional expressions and flow control statements (loops, decisions) Standalone functions (almost never used in practice) Arrays (almost never used in practice use NSArray class instead) C strings (almost never used in practice use NSString class instead) Supports both C-style and C++ style comments Key Differences from C++ Requires a runtime environment (like Java or C#) No using statements / namespaces main() returns void Sizes of built-in types are not standardized, but platform-independent versions are available No operator overloading No function or method overloading a class may not contain two methods with the same name No concept of const correctness Syntax for declaring classes is different Syntax for method declarations and calling methods is very different (derived from Smalltalk messaging) No constructors or destructors Single inheritance classes inherit from one and only one superclass No abstract classes

4 Syntax Additions Protocols define behaviors that cross classes (similar to interfaces in Java or C#) Categories allow you to add new methods to an existing class (as an alternative to subclassing) Some new data types o Generic object type o Class o Selectors Dynamic Runtime Object creation o All objects allocated from heap o No stack based objects Dynamic typing data type of an object can be determined at runtime (introspection) Dynamic binding which version of a method to call is determined at runtime Dynamic loading parts of a program can be loaded into memory at runtime as needed Requires a runtime environment (like Java or C#)

5 Objects An object associates data (state) with the particular operations that can use or affect that data (behavior) Behavior is implemented using methods State is maintained using instance variables Instance variables are internal to the object o State of the object is usually accessible only through the object s methods o Getter/setter methods are often created specifically to access instance variables Object sees only the methods that were designed for it Classes and Instances Objects are defined by defining their class A class definition is a prototype for a kind of object; it declares instance variables and defines methods that all objects of the class can use A class itself is an object in Objective-C o For each class in a program, the compiler creates one class object that knows how to build new objects belonging to that class o A class object is the compiled version of the class; the objects it builds are instances of the class Instances respond to instance methods o Instance methods start with a - o These are the normal methods you are used to o They can access instance variables o They can send messages to self and super inside The keyword self refers to the object that is the receiver of the current method The keyword super refers to the superclass of the message receiver

6 Class objects respond to class methods o Class methods start with a + o Used for memory allocation, singletons, utilities o Can not access instance variables o Messages to self and super mean something a little different o Can only access other class methods OOP Principles Encapsulation o Bundle data with the methods that operate on that data o Keep implementation hidden and separate from interface Polymorphism o Different objects, same interface Inheritance o Base new classes on previously created classes; reuse code, extand or customize behaviors o Inheritance relationships give rise to a hierarchical organization

7 Inheritance Superclass NSObject UIResponder UIView Memory management Generic behaviors UIControl Subclass UIButton UITextField Specific behaviors There is a hierarchical is a relationship exists between subclass and its superclasses o A UIButton is a UIControl (and a UIView, and a UIResponder, and an NSObject) Subclasses inherit behavior and data from their superclasses Subclasses can add new data and methods Subclasses can use, augment, or replace superclass methods

8 Defining a Class In Objective-C, classes are defined in two parts: 1. A public interface that declares the methods and instance variables of the class and names its superclass. Header File 2. A private implementation that actually defines the class (contains the code that implements its methods). Implementation File Sometimes a class definition spans several files through the use of a feature called a category.

9 Class Interface Usually placed in a header file. The declaration of a class interface begins with the compiler and ends with the Class name Superclass name (optional) Protocols (optional) Instance variable declarations Method MyClass : NSObject <ProtocolA, ProtocolB> int count; id data; // Object reference - weak typing NSString *name; // Object reference - strong typing - (id)initwithstring:(nsstring *)aname; + (MyClass *)createmyclasswithstring:(nsstring If colon and superclass name are omitted, new class is declared as a root class. In addition to methods, classes can also declare properties.

10 Access Modifiers and Variables Objective-C supports the following acess modifiers for instance variables: Directive The instance variable is accessible only within the class that declares (Default) The instance variable is accessible within the class that declares it and within classes that inherit The instance variable is accessible We won t worry about this level, since it s mostly useful for framework classes. MyObject : NSObject int int int int height; int int y; foo and bar are protected x and y are private height and width are public

11 Method Declarations Same information as in a C++ method prototype, but syntax is different: Return data type Method takes argument Argument name - (void)setgpa:(double)newgpa; Method type Method name Argument data type Method type is either + (for a class method) or (for an instance method) Some examples: - (void)enrollat:(nsstring *)university withmajor:(nsstring *)major; - (double)gpa; - (void)setgpa:(double)newgpa; - (BOOL)canGraduate; - (Person *)advisor; - (NSString *)name;

12 Importing an Interface The interface file for a class must be included in any source module (header or implementation file) that depends on the class interface o Any module that creates an instance of the class o Any module that sends a message to invoke a method declared for the class o Any module that mentions an instance variable declared in the class An interface is usually included with the #import directive: #import "ClassName.h" Example: #import "Person.h" This directive is identical to #include, except that it makes sure that the same file is never included more than once, eliminating the need for the header guards used in C and C++ An implementation file will normally import its counterpart interface. An interface file will normally import the interface for its superclass. If the superclass is defined in one of the Objective-C frameworks, the import syntax is slightly different: #import <FrameworkName/FrameworkName.h> Examples: #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> Skeleton code provided by Xcode often includes some of the required import statements. Xcode projects may also include a precompiled header file that automatically imports one or more frameworks.

13 Referring to Other Classes An interface file may simply refer to class names without needing to import their interface files. Examples include: o An instance variable declaration o A method return value o A method parameter Declarations like this simply use the class name as a type and don t depend on any details of the class interface (its methods and instance variables). In this case, it is sufficient to declare the class names with Student, Employee; When the interface to a class is actually used (instances created, messages sent), the class interface must be imported. Typically, an interface file to declare classes it refers to, and the corresponding implementation file imports their interfaces.

14 Class Implementation A class implementation begins with the compiler and ends with the #import ClassName // method Methods are defined within a pair of braces. Before the braces, they re declared in the same manner as in the interface file, but without the semicolon. Example: #import Person - (int)age return age; - (void)setage:(int)value age =

15 Class Variables Objective-C does not have syntax for declaring a class variable, a data member that is shared among all instances of a class. You can fake this to some degree by declaring a global variable in your class implementation file and assigning it static linkage: static int enemycount = MyClass // Method The variable enemycount can be accessed by any method of MyClass (including class methods), but is not available to methods or functions declared in other implementation files.

16 Messaging Syntax When you want to call a method, you do so by messaging an object. A message is the method signature, along with the parameter information the method needs. All messages you send to an object are dispatched dynamically, thus facilitating the polymorphic behavior of Objective-C classes. Messages are enclosed by brackets ([ and ]). Inside the brackets, the object receiving the message is on the left side and the message (along with any parameters required by the message) is on the right. Some common message formats: o A message expression with no arguments: [receiver methodname] o A message expression with one argument: [receiver methodname:argument] o A message expression with two arguments: [receiver methodname:arg1 andarg:arg2] o A message expression with a parameter list argument: [receiver methodname:arg1, arg2, arg3, nil]

17 Message Expression Examples Student *student = [[Student alloc] init]; [student enrollat:@"niu" withmajor:@"computer Science"]; [student addclasses:@"csci 628", nil]; double gpa = [student gpa]; [student setgpa:3.85]; if ([student cangraduate]) // Do graduation-related stuff NSString *name = [[student advisor] name];

18 Terminology Message expression [receiver methodname:argument] [receiver methodname:arg1 andarg:arg2] Message [receiver methodname:argument] [receiver methodname:arg1 andarg:arg2] Selector [receiver methodname] [receiver methodname:argument] [receiver methodname:arg1 andarg:arg2] Method The code selected by a message.

19 Dot Syntax Objective-C 2.0 introduced dot syntax as a convenient shorthand for invoking accessor methods. Accessor methods get and set the state of an object, and typically take the form - (type)propertyname and - (void)setpropertyname:(type). float height = [person height]; float height = person.height; [person setheight:newheight]; person.height = newheight; This syntax can be used to replace nested messages: [[person child] setheight:newheight]; // exactly the same as person.child.height = newheight; Declared Properties A declared property provides a shorthand syntax for declaring a class s accessor methods and, optionally, implementing (attributes) data-type variablename;

20 Declared Properties You begin a property declaration with the You can then optionally provide a parenthesized set of property attributes that define the storage semantics and other behaviors of the property. Each property declaration ends with a type specification and a name. For (copy) NSString *title; This syntax is equivalent to declaring the following accessor methods: - (NSString *)title; - (void)settitle:(nsstring *)newtitle; The compiler will automatically synthesize the code for these methods, so you don t need to write them yourself. Read/Write Access readwrite (default) readonly Synchronization atomic (default) nonatomic ARC Storage Semantics strong (default) weak Declared Property Attributes Generate both setter and getter methods. Generate only the getter method. Include synchronization code to make setter and getter atomic operations. Do not include synchronization code for setter and getter, speeding up access. Take ownership of object. Do not take ownership of object; set to nil automatically when there are no remaining strong references to the object. Used with delegates, data sources, outlets, etc. to prevent strong reference cycles. assign No memory management; used with primitive data types. copy Create a copy of the object (which is then maintained with a strong reference). Object must conform to the NSCopying protocol. Often used for strings, arrays, dictionaries, etc. unsafe_unretained Used for an object of a class that does not support weak references.

21 Calling Your Own Methods An object can use the self pointer to invoke methods on itself: - (BOOL)canLegallyVote return (self.age >= 18); - (void)castballot if ([self canlegallyvote]) // Do voting stuff else NSLog(@"I am not allowed to vote!"); Similar to this in Java or C++.

22 Superclass methods Can also invoke superclass methods using super: - (void)dosomething // Call superclass implementation first [super dosomething]; // Then do our custom behavior int foo = bar; //...

23 BOOL Special Type Used to declare variables that will contain either a true or false value. Can be set to the built-in values YES (true, equivalent to 1) and NO (false, equivalent to 0). Example: BOOL isprime = NO; if (isprime)... while (isprime == YES)...

24 Object Types Object references are always declared as pointers: NSString *s; // Only a declaration; no instance is pointed to Declaring a reference pointer does not bring an instance into existence. You can also declare a dynamically-typed object using the data type id, a generic object type. Can be used to store an object of any type (both instances and class objects). id anobject; Just id, not id * (unless you actually want a pointer to a pointer to an object )

25 Instantiating Objects Many classes have factory methods, class methods that will allocate and initialize a new instance of the class for you and return a pointer to it: NSString *s = [NSString string]; // Create empty NSString object // Create NSString object from NSString literal NSString *s2 = [NSString stringwithstring:@"hello, world"]; Many classes have methods that simply return a pointer to an existing object: NSArray @"Three"]; // Array of 3 NSString objects NSString *s = [array objectatindex:2]; // s now points to the Allocating and initializing an instance from scratch is a two step process: allocation, then initialization. The steps must happen one right after the other, so this is usually done using two nested messages: NSString *name = [[NSString alloc] init]; Heap storage for the new object is allocated by the NSObject class method + (id)alloc. The object is initialized with an init method. Classes can have multiple, different initializers (with arguments) in addition to plain init. There s no method overloading, so the methods will have different names. If a class can t be fully initialized by plain init, it is supposed to raise an exception in init. NSObject s only initializer is init. If an initialization method has arguments, its name should still start with the word init. Some NSString examples: - (id)initwithcstring:(const char *)str encoding:(nsstringencoding)encoding; - (id)initwithdata:(nsdata *)data encoding:(nsstringencoding)encoding; - (id)initwithstring:(nsstring *)astring;

26 Writing Your Own Initializer Classes must have a designated initializer. This is the initializer that subclasses must use to initialize themselves in their designated initializer. A class may also have other convenience initializers. These will typically call the designated initializer as part of their code. Example: // Designated initializer - (id)initwithvalue:(int)avalue self = [super init]; // call the superclass designated initializer if (self) // initialize our subclass data members here value = avalue; return self; // Convenience initializer - (id)init self = [self initwithvalue:0]; // call our own designated initializer return self;

27 The nil Object Pointer You can assign an object reference pointer the special value nil (address 0, similar to NULL in C++ or null in Java) NSString *s = nil; You can test whether or not an object reference contains nil explicitly: if (nil == s) //... Or implicitly: if (!s) //... It is valid to send a message to a nil object reference unlike most languages, doing this will not cause a runtime error. Instead, the method you are trying to execute will generally do nothing or return nil: NSString *s = nil; // s is nil NSString *s2 = [s uppercasestring]; // now s2 is nil

28 Selectors A selector has data type SEL: SEL action = [button action]; [button setaction:@selector(start:)]; Conceptually similar to a pointer to a function. As shown previously, selectors include all parts of the method name and all colons; for example: - (void)setname:(nsstring *)name age:(int)age; would have the selector: SEL sel Working with Selectors You can determine if an object responds to a given selector: id obj; SEL sel if ([obj respondstoselector:sel]) [obj performselector:sel withobject:self] This sort of introspection and dynamic messaging underlies many Cocoa design patterns. - (void)settarget:(id)target; - (void)setaction:(sel)action;

29 Class Introspection You can ask an object about its class: Class myclass = [myobject class]; NSLog(@"My class is %@", [myobject classname]); Testing for general class membership (subclasses included): if ([myobject iskindofclass:[uicontrol class]]) // something Testing for specific class membership (subclasses excluded): if ([myobject ismemberofclass:[nsstring class]]) // something string specific These methods are largely defined in the NSObject class or in the NSObject protocol that it conforms to.

30 Object Identity vs. Object Equality Identity testing equality of the pointer values (addresses) if (object1 == object2) same object instance"); Equality testing object attributes if ([object1 isequal:object2]) equivalent, but may be different object instances"); Object Assignment Assigning one object reference to another does not make a copy of the object it makes a copy of the object s address. So now you have two object references pointing to the same object.

31 - description Method NSObject class implements the - description method: - (NSString *)description; Objects are represented in format strings using %@ (the format specifier for NSString). When an object appears in a format string, it is asked for its description: [NSString stringwithformat:@"the answer is %@", myobject]; You can log an object s description with NSLog: NSLog([anObject description]); NSLog(@"Object at index %d is %@", index, [anarray[index] description]); Your custom subclasses can override - description to return more specific information.

32 Protocols You can specify that a class conforms to a protocol in its interface HWAppDelegate : NSObject <UIApplicationDelegate> Multiple protocol names may be specified, separated by commas. You must then implement the required protocol methods in your class implementation. You can check whether an object conforms to a protocol by using the conformstoprotocol: method: for (id currentobject in myarray) if ([currentobject conformstoprotocol:@protocol(nscopying)]) // Call a required method from the NSCopying protocol directive used here takes a protocol name and produces a Protocol object, which is what the conformstoprotocol: method expects as its argument. You can get the compiler to check for for conformance with your variables by including the protocol name after the type name: id <NSCopying> currentobject; This tells the compiler that currentobject will reference objects that conform to the NSCopying protocol. If you assign a statically-typed object to currentobject that does not conform to the protocol, the compiler will issue a warning message. As when declaring a class implementation, you can list multiple protocol names separated by commas when specifying that an object should conform to a protocol.

33 Foundation Framework Classes NSObject Base class for practically every object in the ios SDK Implements memory management Implements introspection methods NSString International (any language) strings using Unicode. Used throughout ios instead of C language s char * type. NSString An NSString instance can not be modified! They are immutable. Usual usage pattern is to send a message to an NSString and it will return you a new one. [display settext:[[display text] stringbyappendingstring:digit]]; // same but with dot notation display.text = [display.text stringbyappendingstring:digit]; // class method display.text = [NSString stringwithformat:@"%g", number]; Tons of utility functions available (case conversion, URLs, substrings, type conversions, etc.).

34 NSMutableString Mutable version of NSString. Can do some of the things NSString can do without creating a new one (i.e., in-place changes). NSMutableString *mutstring = [[NSMutableString alloc] initwithstring:@"0."]; [mutstring appendstring:digit]; NSNumber Object wrapper around primitive numeric types like int, float, double, BOOL, etc. NSNumber *num = [NSNumber numberwithfloat:36.5]; float f = [num floatvalue]; @805.23e-10 Useful when you want to put these primitive types in a collection (e.g. NSArray or NSDictionary). NSValue Generic object wrapper for other non-object data types. CGPoint point = CGPointMake(25.0, 15.0); NSValue *val = [NSValue valuewithcgpoint:point];

35 NSData Bag of bits. Used to save/restore/transmit data throughout the ios SDK. NSDate Used to find out the time right now or to store past or future times/dates. See also NSCalendar, NSDateFormatter, NSDateComponents. NSArray Ordered collection of objects. Immutable. You cannot add objects to it or remove objects from it once it s created. NSArray value2, value2, ] Important methods: + (id)arraywithobjects:(id)firstobject,...; - (int)count; - (id)objectatindex:(int)index; - (void)makeobjectsperformselector:(sel)aselector; - (NSArray *)sortedarrayusingselector:(sel)aselector; - (id)lastobject; // returns nil if there are no objects in the array // (convenient) Bracket notation to access elements: mystring = [myarray objectatindex:2]; mystring = myarray[2];

36 NSMutableArray Mutable version of NSArray. - (void)addobject:(id)anobject; - (void)insertobject:(id)anobject atindex:(int)index; - (void)removeobjectatindex:(int)index; NSDictionary Hash table. Look up objects using a key to get a value. Immutable. NSDictionary : value1, key2 : value2, Keys are objects which must implement - (NSUInteger)hash and - (BOOL)isEqual:(NSObject *)obj Keys are usually NSString objects. Important methods: - (int)count; - (id)objectforkey:(id)key; - (NSArray *)allkeys; - (NSArray *)allvalues; Bracket notation to access values: myvalue = [mydictionary objectforkey:@"name"]; myvalue = mydictionary[@"name"];

37 NSMutableDictionary Mutable version of NSDictionary. NSSet - (void)setobject:(id)anobject forkey:(id)key; - (void)removeobjectforkey:(id)key; - (void)addentriesfromdictionary:(nsdictionary *)otherdictionary; Unordered collection of objects. Immutable. Important methods: - (int)count; - (BOOL)containsObject:(id)anObject; - (id)anyobject; - (void)makeobjectsperformselector:(sel)aselector; - (id)member:(id)anobject; // uses isequal: and returns a matching object // (if any) NSMutableSet Mutable version of NSSet. - (void)addobject:(id)anobject; - (void)removeobject:(id)anobject; - (void)unionset:(nsset *)otherset; - (void)minusset:(nsset *)otherset; - (void)intersectset:(nsset *)otherset;

38 Fast Enumeration Looping through members of a collection in an efficient manner Language support using for-in (similar to Java) Example: NSArray of NSString objects NSArray *myarray =...; for (NSString *string in myarray) // crash here if string is not an NSString double value = [string doublevalue]; Example: NSSet of id (could just as easily be an NSArray of id) NSSet *myset =...; for (id obj in myset) // do something with obj, but make sure you don t send it // a message it does not respond to if ([obj iskindofclass:[nsstring class]]) // send NSString messages to obj with impunity

39 Fast Enumeration Looping through the keys or values of a dictionary Example: NSDictionary *mydictionary =...; for (id key in mydictionary) // do something with key here id value = [mydictionary objectforkey:key]; // do something with value here

40 References APPLE INC., Object-oriented programming with Objective-C. APPLE INC., Programming with Objective-C. tion.html KOCHAN, S. G., Programming in Objective-C, Third Edition. Addison Wesley, Upper Saddle River, NJ.

Introduction to Objective-C. Kevin Cathey

Introduction to Objective-C. Kevin Cathey Introduction to Objective-C Kevin Cathey Introduction to Objective-C What are object-oriented systems? What is the Objective-C language? What are objects? How do you create classes in Objective-C? acm.uiuc.edu/macwarriors/devphone

More information

iphone SDK Enrolled students will be invited to developer program Login to Program Portal Request a Certificate Download and install the SDK

iphone SDK Enrolled students will be invited to developer program Login to Program Portal Request a Certificate Download and install the SDK Objective-C Basics iphone SDK Enrolled students will be invited to developer program Login to Program Portal Request a Certificate Download and install the SDK The First Program in Objective-C #import

More information

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 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

More information

ios Dev Fest Research Network Operations Center Thursday, February 7, 13

ios Dev Fest Research Network Operations Center Thursday, February 7, 13 ios Dev Fest Research Network Operations Center Outline http://goo.gl/02blw Getting Started With App Development Setup Developer Environment Setup Certificates and Provisioning Deploying App To Device

More information

MA-WA1920: Enterprise iphone and ipad Programming

MA-WA1920: Enterprise iphone and ipad Programming MA-WA1920: Enterprise iphone and ipad Programming Description This 5 day iphone training course teaches application development for the ios platform. It covers iphone, ipad and ipod Touch devices. This

More information

Key-Value Coding Programming Guide

Key-Value Coding Programming Guide Key-Value Coding Programming Guide Contents Introduction 6 Organization of This Document 6 See Also 7 What Is Key-Value Coding? 8 Key-Value Coding and Scripting 8 Using Key-Value Coding to Simplify Your

More information

Objective C and iphone App

Objective C and iphone App Objective C and iphone App 6 Months Course Description: Understanding the Objective-C programming language is critical to becoming a successful iphone developer. This class is designed to teach you a solid

More information

Creating a Custom Class in Xcode

Creating a Custom Class in Xcode Creating a Custom Class in Xcode By Mark Mudri March 28, 2014 Executive Summary: Making an ios application requires the use of Xcode, an integrated development environment (IDE) developed by Apple. Within

More information

Object Oriented Programming and the Objective-C Programming Language 1.0. (Retired Document)

Object Oriented Programming and the Objective-C Programming Language 1.0. (Retired Document) Object Oriented Programming and the Objective-C Programming Language 1.0 (Retired Document) Contents Introduction to The Objective-C Programming Language 1.0 7 Who Should Read This Document 7 Organization

More information

iphone Objective-C Exercises

iphone Objective-C Exercises iphone Objective-C Exercises About These Exercises The only prerequisite for these exercises is an eagerness to learn. While it helps to have a background in object-oriented programming, that is not a

More information

Moving from CS 61A Scheme to CS 61B Java

Moving from CS 61A Scheme to CS 61B Java Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you

More information

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

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

More information

Common Lisp ObjectiveC Interface

Common Lisp ObjectiveC Interface Common Lisp ObjectiveC Interface Documentation for the Common Lisp Objective C Interface, version 1.0. Copyright c 2007 Luigi Panzeri Copying and distribution of this file, with or without modification,

More information

Fundamentals of Java Programming

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

More information

From C++ to Objective-C

From C++ to Objective-C From C++ to Objective-C version 2.1 en Pierre Chatelier e-mail: pierre.chatelier@club-internet.fr Copyright c 2005, 2006, 2007, 2008, 2009 Pierre Chatelier English adaptation : Aaron Vegh Document revisions

More information

Assignment I Walkthrough

Assignment I Walkthrough Assignment I Walkthrough Objective Reproduce the demonstration (building a calculator) given in class. Goals 1. Downloading and installing the ios4 SDK. 2. Creating a new project in Xcode. 3. Defining

More information

Objective-C for Experienced Programmers

Objective-C for Experienced Programmers Objective-C for Experienced Programmers Venkat Subramaniam venkats@agiledeveloper.com twitter: venkat_s Objective-C An Object-Oriented extension to C If you re familiar with C/C++/Java syntax, you re at

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

ios Dev Crib Sheet In the Shadow of C

ios Dev Crib Sheet In the Shadow of C ios Dev Crib Sheet As you dive into the deep end of the ios development pool, the first thing to remember is that the mother ship holds the authoritative documentation for this endeavor http://developer.apple.com/ios

More information

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007 Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007 The Java Type System By now, you have seen a fair amount of Java. Time to study in more depth the foundations of the language,

More information

Java Interview Questions and Answers

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

More information

Objective-C and Cocoa User Guide and Reference Manual. Version 5.0

Objective-C and Cocoa User Guide and Reference Manual. Version 5.0 Objective-C and Cocoa User Guide and Reference Manual Version 5.0 Copyright and Trademarks LispWorks Objective-C and Cocoa Interface User Guide and Reference Manual Version 5.0 March 2006 Copyright 2006

More information

Praktikum Entwicklung von Mediensystemen mit

Praktikum Entwicklung von Mediensystemen mit Praktikum Entwicklung von Mediensystemen mit Wintersemester 2013/2014 Christian Weiß, Dr. Alexander De Luca Today Organization Introduction to ios programming Hello World Assignment 1 2 Organization 6

More information

ios App Development for Everyone

ios App Development for Everyone ios App Development for Everyone Kevin McNeish Table of Contents Chapter 2 Objective C (Part 1) When I first started writing ios Apps, coding in Objective-C was somewhat painful. Like stuck-in-acheckout-line-behind-the-old-woman-writing-a-personal-check

More information

Object Oriented Software Design II

Object Oriented Software Design II Object Oriented Software Design II Introduction to C++ Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 20, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February

More information

An Introduction to Modern Software Development Tools Creating A Simple GUI-Based Tool Appleʼs XCode Version 3.2.6

An Introduction to Modern Software Development Tools Creating A Simple GUI-Based Tool Appleʼs XCode Version 3.2.6 1 2 3 4 An Introduction to Modern Software Development Tools Creating A Simple GUI-Based Tool Appleʼs XCode Version 3.2.6 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Charles J. Ammon / Penn State August, 2011

More information

C++ INTERVIEW QUESTIONS

C++ INTERVIEW QUESTIONS C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

13 Classes & Objects with Constructors/Destructors

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.

More information

Chapter 1 Fundamentals of Java Programming

Chapter 1 Fundamentals of Java Programming Chapter 1 Fundamentals of Java Programming Computers and Computer Programming Writing and Executing a Java Program Elements of a Java Program Features of Java Accessing the Classes and Class Members The

More information

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

KITES TECHNOLOGY COURSE MODULE (C, C++, DS) KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL

More information

Praktikum Entwicklung von Mediensystemen mit ios

Praktikum Entwicklung von Mediensystemen mit ios Praktikum Entwicklung von Mediensystemen mit ios SS 2011 Michael Rohs michael.rohs@ifi.lmu.de MHCI Lab, LMU München Timeline Date Topic/Activity 5.5.2011 Introduction and Overview of the ios Platform 12.5.2011

More information

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

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

More information

Glossary of Object Oriented Terms

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

More information

This documentation is made available before final release and is subject to change without notice and comes with no warranty express or implied.

This documentation is made available before final release and is subject to change without notice and comes with no warranty express or implied. Hyperloop for ios Programming Guide This documentation is made available before final release and is subject to change without notice and comes with no warranty express or implied. Requirements You ll

More information

JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system.

JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system. http://www.tutorialspoint.com/java/java_quick_guide.htm JAVA - QUICK GUIDE Copyright tutorialspoint.com What is Java? Java is: Object Oriented Platform independent: Simple Secure Architectural- neutral

More information

Introduction to iphone Development

Introduction to iphone Development Introduction to iphone Development Introduction to iphone Development Contents Task 1 2 3 4 Application Runtime Core Architecture and Life-cycles What s in a bundle? The resources in an app bundle Customizing

More information

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 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

More information

CS 111 Classes I 1. Software Organization View to this point:

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

More information

Praktikum Entwicklung von Mediensystemen mit ios

Praktikum Entwicklung von Mediensystemen mit ios Praktikum Entwicklung von Mediensystemen mit ios SS 2011 Michael Rohs michael.rohs@ifi.lmu.de MHCI Lab, LMU München Today Schedule Organization Introduction to ios Exercise 1 2 Schedule Phase 1 Individual

More information

ios Development Tutorial Nikhil Yadav CSE 40816/60816: Pervasive Health 09/09/2011

ios Development Tutorial Nikhil Yadav CSE 40816/60816: Pervasive Health 09/09/2011 ios Development Tutorial Nikhil Yadav CSE 40816/60816: Pervasive Health 09/09/2011 Healthcare iphone apps Various apps for the iphone available Diagnostic, Diet and Nutrition, Fitness, Emotional Well-being

More information

Objective-C Tutorial

Objective-C Tutorial Objective-C Tutorial OBJECTIVE-C TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Objective-c tutorial Objective-C is a general-purpose, object-oriented programming

More information

Java Application Developer Certificate Program Competencies

Java Application Developer Certificate Program Competencies Java Application Developer Certificate Program Competencies After completing the following units, you will be able to: Basic Programming Logic Explain the steps involved in the program development cycle

More information

CS193j, Stanford Handout #10 OOP 3

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

More information

Stack Allocation. Run-Time Data Structures. Static Structures

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,

More information

Chapter 1 Java Program Design and Development

Chapter 1 Java Program Design and Development presentation slides for JAVA, JAVA, JAVA Object-Oriented Problem Solving Third Edition Ralph Morelli Ralph Walde Trinity College Hartford, CT published by Prentice Hall Java, Java, Java Object Oriented

More information

Java (12 Weeks) Introduction to Java Programming Language

Java (12 Weeks) Introduction to Java Programming Language Java (12 Weeks) Topic Lecture No. Introduction to Java Programming Language 1 An Introduction to Java o Java as a Programming Platform, The Java "White Paper" Buzzwords, Java and the Internet, A Short

More information

16 Collection Classes

16 Collection Classes 16 Collection Classes Collections are a key feature of the ROOT system. Many, if not most, of the applications you write will use collections. If you have used parameterized C++ collections or polymorphic

More information

History OOP languages Year Language 1967 Simula-67 1983 Smalltalk

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

More information

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

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

More information

Habanero Extreme Scale Software Research Project

Habanero Extreme Scale Software Research Project Habanero Extreme Scale Software Research Project Comp215: Java Method Dispatch Zoran Budimlić (Rice University) Always remember that you are absolutely unique. Just like everyone else. - Margaret Mead

More information

Crash Course in Java

Crash Course in Java Crash Course in Java Based on notes from D. Hollinger Based in part on notes from J.J. Johns also: Java in a Nutshell Java Network Programming and Distributed Computing Netprog 2002 Java Intro 1 What is

More information

C++FA 5.1 PRACTICE MID-TERM EXAM

C++FA 5.1 PRACTICE MID-TERM EXAM C++FA 5.1 PRACTICE MID-TERM EXAM This practicemid-term exam covers sections C++FA 1.1 through C++FA 1.4 of C++ with Financial Applications by Ben Van Vliet, available at www.benvanvliet.net. 1.) A pointer

More information

Comp 411 Principles of Programming Languages Lecture 34 Semantics of OO Languages. Corky Cartwright Swarat Chaudhuri November 30, 20111

Comp 411 Principles of Programming Languages Lecture 34 Semantics of OO Languages. Corky Cartwright Swarat Chaudhuri November 30, 20111 Comp 411 Principles of Programming Languages Lecture 34 Semantics of OO Languages Corky Cartwright Swarat Chaudhuri November 30, 20111 Overview I In OO languages, data values (except for designated non-oo

More information

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

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

More information

Android Application Development Course Program

Android Application Development Course Program Android Application Development Course Program Part I Introduction to Programming 1. Introduction to programming. Compilers, interpreters, virtual machines. Primitive data types, variables, basic operators,

More information

DIPLOMADO DE JAVA - OCA

DIPLOMADO DE JAVA - OCA DIPLOMADO DE JAVA - OCA TABLA DE CONTENIDO INTRODUCCION... 3 ESTRUCTURA DEL DIPLOMADO... 4 Nivel I:... 4 Fundamentals of the Java Programming Language Java SE 7... 4 Introducing the Java Technology...

More information

INTRODUCTION TO IOS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 13 02/22/2011

INTRODUCTION TO IOS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 13 02/22/2011 INTRODUCTION TO IOS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 13 02/22/2011 1 Goals of the Lecture Present an introduction to ios Program Coverage of the language will be INCOMPLETE We

More information

Using PyObjC for Developing Cocoa Applications with Python

Using PyObjC for Developing Cocoa Applications with Python Search Advanced Search Log In Not a Member? Contact ADC ADC Home > Cocoa > While Cocoa applications are generally written in Objective-C, Python is a fully capable choice for application development. Python

More information

Copyright. Restricted Rights Legend. Trademarks or Service Marks. Copyright 2003 BEA Systems, Inc. All Rights Reserved.

Copyright. Restricted Rights Legend. Trademarks or Service Marks. Copyright 2003 BEA Systems, Inc. All Rights Reserved. Version 8.1 SP4 December 2004 Copyright Copyright 2003 BEA Systems, Inc. All Rights Reserved. Restricted Rights Legend This software and documentation is subject to and made available only pursuant to

More information

Example of a Java program

Example of a Java program Example of a Java program class SomeNumbers static int square (int x) return x*x; public static void main (String[] args) int n=20; if (args.length > 0) // change default n = Integer.parseInt(args[0]);

More information

11 November 2015. www.isbe.tue.nl. www.isbe.tue.nl

11 November 2015. www.isbe.tue.nl. www.isbe.tue.nl UML Class Diagrams 11 November 2015 UML Class Diagrams The class diagram provides a static structure of all the classes that exist within the system. Classes are arranged in hierarchies sharing common

More information

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

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

More information

Object-Oriented Programming Lecture 2: Classes and Objects

Object-Oriented Programming Lecture 2: Classes and Objects Object-Oriented Programming Lecture 2: Classes and Objects Dr. Lê H!ng Ph"#ng -- Department of Mathematics, Mechanics and Informatics, VNUH July 2012 1 Content Class Object More on class Enum types Package

More information

java Features Version April 19, 2013 by Thorsten Kracht

java Features Version April 19, 2013 by Thorsten Kracht java Features Version April 19, 2013 by Thorsten Kracht Contents 1 Introduction 2 1.1 Hello World................................................ 2 2 Variables, Types 3 3 Input/Output 4 3.1 Standard I/O................................................

More information

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

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

More information

Beginner level: Modules 1 to 18. Advanced level: Quick review of modules 1 to 18, then following to module 26. 1- A Simple ios Application

Beginner level: Modules 1 to 18. Advanced level: Quick review of modules 1 to 18, then following to module 26. 1- A Simple ios Application FROM 1st TO 4th OF FEBRUARY 2012 contents of the app s creation training track Beginner level: Modules 1 to 18. Advanced level: Quick review of modules 1 to 18, then following to module 26. 1- A Simple

More information

Exception Handling. Overloaded methods Interfaces Inheritance hierarchies Constructors. OOP: Exception Handling 1

Exception Handling. Overloaded methods Interfaces Inheritance hierarchies Constructors. OOP: Exception Handling 1 Exception Handling Error handling in general Java's exception handling mechanism The catch-or-specify priciple Checked and unchecked exceptions Exceptions impact/usage Overloaded methods Interfaces Inheritance

More information

Basic Object-Oriented Programming in Java

Basic Object-Oriented Programming in Java core programming Basic Object-Oriented Programming in Java 1 2001-2003 Marty Hall, Larry Brown http:// Agenda Similarities and differences between Java and C++ Object-oriented nomenclature and conventions

More information

Developing Applications for ios

Developing Applications for ios Developing Applications for ios Today Introduction to Objective-C (con t) Continue showing Card Game Model with Deck, PlayingCard, PlayingCardDeck Xcode 5 Demonstration Start building the simple Card Game

More information

www.sahajsolns.com Chapter 4 OOPS WITH C++ Sahaj Computer Solutions

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,

More information

core. Volume I - Fundamentals Seventh Edition Sun Microsystems Press A Prentice Hall Title ULB Darmstadt

core. Volume I - Fundamentals Seventh Edition Sun Microsystems Press A Prentice Hall Title ULB Darmstadt core. 2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Volume I - Fundamentals Seventh Edition CAY S. HORSTMANN GARY

More information

Chapter 13 - Inheritance

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

More information

Topics. Parts of a Java Program. Topics (2) CS 146. Introduction To Computers And Java Chapter Objectives To understand:

Topics. Parts of a Java Program. Topics (2) CS 146. Introduction To Computers And Java Chapter Objectives To understand: Introduction to Programming and Algorithms Module 2 CS 146 Sam Houston State University Dr. Tim McGuire Introduction To Computers And Java Chapter Objectives To understand: the meaning and placement of

More information

What is Java? Applications and Applets: Result of Sun s efforts to remedy bad software engineering practices

What is Java? Applications and Applets: Result of Sun s efforts to remedy bad software engineering practices What is Java? Result of Sun s efforts to remedy bad software engineering practices It is commonly thought of as a way to make Web pages cool. It has evolved into much more. It is fast becoming a computing

More information

BCS2B02: OOP Concepts and Data Structures Using C++

BCS2B02: OOP Concepts and Data Structures Using C++ SECOND SEMESTER BCS2B02: OOP Concepts and Data Structures Using C++ Course Number: 10 Contact Hours per Week: 4 (2T + 2P) Number of Credits: 2 Number of Contact Hours: 30 Hrs. Course Evaluation: Internal

More information

Classes and Objects in Java Constructors. In creating objects of the type Fraction, we have used statements similar to the following:

Classes and Objects in Java Constructors. In creating objects of the type Fraction, we have used statements similar to the following: In creating objects of the type, we have used statements similar to the following: f = new (); The parentheses in the expression () makes it look like a method, yet we never created such a method in our

More information

ios App Programming Guide

ios App Programming Guide ios App Programming Guide Contents About ios App Programming 8 At a Glance 8 Translate Your Initial Idea into an Implementation Plan 9 UIKit Provides the Core of Your App 9 Apps Must Behave Differently

More information

COMP327 Mobile Computing Session: 2014-2015. Lecture Set 4 - Data Persistence, Core Data and Concurrency

COMP327 Mobile Computing Session: 2014-2015. Lecture Set 4 - Data Persistence, Core Data and Concurrency COMP327 Mobile Computing Session: 2014-2015 Lecture Set 4 - Data Persistence, Core Data and Concurrency In these Slides... We will cover... An introduction to Local Data Storage The iphone directory system

More information

AP Computer Science Java Subset

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

More information

The Smalltalk Programming Language. Beatrice Åkerblom beatrice@dsv.su.se

The Smalltalk Programming Language. Beatrice Åkerblom beatrice@dsv.su.se The Smalltalk Programming Language Beatrice Åkerblom beatrice@dsv.su.se 'The best way to predict the future is to invent it' - Alan Kay. History of Smalltalk Influenced by Lisp and Simula Object-oriented

More information

UML for C# Modeling Basics

UML for C# Modeling Basics UML for C# C# is a modern object-oriented language for application development. In addition to object-oriented constructs, C# supports component-oriented programming with properties, methods and events.

More information

Operator Overloading. Lecture 8. Operator Overloading. Running Example: Complex Numbers. Syntax. What can be overloaded. Syntax -- First Example

Operator Overloading. Lecture 8. Operator Overloading. Running Example: Complex Numbers. Syntax. What can be overloaded. Syntax -- First Example Operator Overloading Lecture 8 Operator Overloading C++ feature that allows implementer-defined classes to specify class-specific function for operators Benefits allows classes to provide natural semantics

More information

Tag Specification Document

Tag Specification Document Measuring the digital world. DIGITAL ANALYTIX ios Mobile Application Measurement Tag Specification Document March 2012 FOR FURTHER INFORMATION, PLEASE CONTACT: comscore, Inc. +1 866 276 6972 sdksupport@comscore.com

More information

Getting Started with the Internet Communications Engine

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

More information

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6)

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6) Semantic Analysis Scoping (Readings 7.1,7.4,7.6) Static Dynamic Parameter passing methods (7.5) Building symbol tables (7.6) How to use them to find multiply-declared and undeclared variables Type checking

More information

ios App Development for Everyone

ios App Development for Everyone ios App Development for Everyone Kevin McNeish Table of Contents Chapter 2 Objective C (Part 6) Referencing Classes Now you re ready to use the Calculator class in the App. Up to this point, each time

More information

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies) Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies) Duration of Course: 6 Months Fees: Rs. 25,000/- (including Service Tax) Eligibility: B.E./B.Tech., M.Sc.(IT/ computer

More information

Programming Languages CIS 443

Programming Languages CIS 443 Course Objectives Programming Languages CIS 443 0.1 Lexical analysis Syntax Semantics Functional programming Variable lifetime and scoping Parameter passing Object-oriented programming Continuations Exception

More information

Infrastructure that supports (distributed) componentbased application development

Infrastructure that supports (distributed) componentbased application development Middleware Technologies 1 What is Middleware? Infrastructure that supports (distributed) componentbased application development a.k.a. distributed component platforms mechanisms to enable component communication

More information

The Interface Concept

The Interface Concept Multiple inheritance Interfaces Four often used Java interfaces Iterator Cloneable Serializable Comparable The Interface Concept OOP: The Interface Concept 1 Multiple Inheritance, Example Person name()

More information

AC 2012-3338: OBJECTIVE-C VERSUS JAVA FOR SMART PHONE AP- PLICATIONS

AC 2012-3338: OBJECTIVE-C VERSUS JAVA FOR SMART PHONE AP- PLICATIONS AC 2012-3338: OBJECTIVE-C VERSUS JAVA FOR SMART PHONE AP- PLICATIONS Dr. Mohammad Rafiq Muqri, DeVry University, Pomona Mr. James R. Lewis, DeVry University, Pomona c American Society for Engineering Education,

More information

Symbol Tables. Introduction

Symbol Tables. Introduction Symbol Tables Introduction A compiler needs to collect and use information about the names appearing in the source program. This information is entered into a data structure called a symbol table. The

More information

Friendship and Encapsulation in C++

Friendship and Encapsulation in C++ Friendship and Encapsulation in C++ Adrian P Robson Department of Computing University of Northumbria at Newcastle 23rd October 1995 Abstract There is much confusion and debate about friendship and encapsulation

More information

The Cool Reference Manual

The Cool Reference Manual The Cool Reference Manual Contents 1 Introduction 3 2 Getting Started 3 3 Classes 4 3.1 Features.............................................. 4 3.2 Inheritance............................................

More information

Bonus ChapteR. Objective-C

Bonus ChapteR. Objective-C Bonus ChapteR Objective-C If you want to develop native ios applications, you must learn Objective-C. For many, this is an intimidating task with a steep learning curve. Objective-C mixes a wide range

More information

In order to understand Perl objects, you first need to understand references in Perl. See perlref for details.

In order to understand Perl objects, you first need to understand references in Perl. See perlref for details. NAME DESCRIPTION perlobj - Perl object reference This document provides a reference for Perl's object orientation features. If you're looking for an introduction to object-oriented programming in Perl,

More information

Designing with Exceptions. CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219

Designing with Exceptions. CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219 Designing with Exceptions CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219 Testing vs. Debugging Testing Coding Does the code work properly YES NO 2 Debugging Testing

More information

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 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

More information