Factory Methods y init-alloc, new

Objects Are Created Dynamically   Memory is allocated dynamically for an Objective-C object. The first step in creating an object is to make sure enough memory is allocated not only for the properties defined by an object’s class, but also the properties defined on each of the superclasses in its […]


‘this’ pointer en C++

The ‘this’ pointer is passed as a hidden argument to all nonstatic member function calls and is available as a local variable within the body of all nonstatic functions. ‘this’ pointer is a constant pointer that holds the memory address of the current object. ‘this’ pointer is not available in […]

Leyendo del teclado en Java

We can use Scanner class Import first: import java.util.Scanner;import java.util.Scanner; Then we go this way for integers. Scanner keyboard = new Scanner(System.in); System.out.println("enter an integer"); int myint = keyboard.nextInt();Scanner keyboard = new Scanner(System.in); System.out.println("enter an integer"); int myint = keyboard.nextInt(); If we rather a string line: String text= scan.nextLine();String text= scan.nextLine(); Easy […]



Static Los métodos static no requieren una instancia de la clase, ni pueden acceder a los datos de la clase/objeto de forma implícita. Un método static se distingue en algunos lenguajes de programación con la palabra clave static colocada en algún lugar en la firma del método. Los metodos estaticos […]

Clases Locales y Anónimas interiores en Java

Local and Anonymous Inner Classes in Java Local Inner Classes in Java If an inner class has been defined within a code block (typically within the body of a method), then such an inner class is called a local inner class. A local inner class is not a member of […]