Tutorial by Topics: cts

Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behaviors – wagging the tail, barking, eating. An object is an instance of a class. Class − A class can be defined as a template/blueprint that describes the behavior/state that the object of its type suppo...
An Android application needs to run on all kinds of devices. Each device may have a different version on Android running on it. Now, each Android version might not support all the features that your app requires, and so while building an app, you need to keep the minimum and maximum Android version...
object = { } object = new Object() object = Object.create(prototype[, propertiesObject]) object.key = value object["key"] = value object[Symbol()] = value object = { key1: value1, "key2": value2, 'key3': value3 } object = { conciseMethod() { … } } object = { [computed(...
Structs are sets of various variables packed together. The struct itself is only a package containing variables and making them easily accessible. Unlike in C, Go's structs can have methods attached to them. It also allows them to implement interfaces. That makes Go's structs similar to objects, bu...
Classes and Objects are used to to make your code more efficient and less repetitive by grouping similar tasks. A class is used to define the actions and data structure used to build objects. The objects are then built using this predefined structure. class <ClassName> [ extends <Par...
Cat *cat = [[Cat alloc] init]; // Create cat object of type Cat Dog *dog = [[Dog alloc] init]; // Create dog object of type Dog NSObject *someObject = [NSObject alloc]; [someObject init]; // don’t do this XYZObject *object = [XYZObject new]; // Use new to create objects if NO arguments...
Unlike classes, a struct is a value type, and is created on the local stack and not on the managed heap, by default. This means that once the specific stack goes out of scope, the struct is de-allocated. Contained reference types of de-allocated structs are also swept, once the GC determines they ...
Structures provide a way to group a set of related variables of diverse types into a single unit of memory. The structure as a whole can be referenced by a single name or pointer; the structure members can be accessed individually too. Structures can be passed to functions and returned from function...
addChild(child) - adds a new item to this object's child tree as the topmost element. addChildAt(child, index) - adds a new item to this object's child tree at a specified position. The bottom-most item has index of 0. getChildAt(index) - returns a child with given index. getChildIndex(child) r...
Variations of Markdown with differing syntax are called "flavors." Markdown flavors are listed at https://github.com/jgm/CommonMark/wiki/Markdown-Flavors. A Markdown flavor can be implemented in various programming languages and software applications. Libraries that implement a Markdown...
serialize($object) unserialize($object) All PHP types except for resources are serializable. Resources are a unique variable type that reference "external" sources, such as database connections.
Code contracts allow for compile or runtime analysis of pre/post conditions of methods and invariant conditions for objects. These conditions may be used to ensure callers and return value match valid states for application processing. Other uses for Code Contracts include documentation generati...
class MyClass{} // curly braces are optional here as class body is empty class MyClassWithMethod {def method: MyClass = ???} new MyClass() //Instantiate object MyObject // Singleton object class MyClassWithGenericParameters[V1, V2](vl: V1, i: Int, v2: V2) class MyClassWithImplicitFieldCreati...
Note: In Python 2, make sure that your class inherits from object (making it a new-style class) in order for all features of properties to be available.

Page 1 of 5