Converting C++ Abstract Classes into Java Interfaces
One of the most innovative aspects of Java is the interface. An interface specifies the form of its various methods without specifying any implementation details. Each class that i
Read tutorialTHE TUTORIAL LIBRARY
One of the most innovative aspects of Java is the interface. An interface specifies the form of its various methods without specifying any implementation details. Each class that i
Read tutorialThe C++ pointer parameter, In Java, became a reference parameter. Of course, C++ also supports reference parameters. As mentioned, most pointer parameters found in C++ code are sim
Read tutorialConceptually, converting C++-style pointer-based array accessing into the equivalent Java-compatible array indexing is straightforward—simply substitute the appropriate array-ind
Read tutorialFor the most part, it is quite easy to convert a C++ function that uses pointer parameters into its equivalent Java method. Since Java passes all objects by reference, sometimes th
Read tutorialA reference is an alias; when you create a reference, you initialize it with the name of another object, the target. From that moment on, the reference acts as an alternative name
Read tutorialYou can use the keyword const for pointers before the type, after the type, or in both places. For example, all of the following are legal declarations:
Read tutorialOne source of bugs that are nasty and difficult to find is stray pointers. A stray pointer is created when you call delete on a pointer--thereby freeing the memory that it points t
Read tutorialEvery class member function has a hidden parameter: the this pointer. this points to the individual object. Therefore, in each call to GetAge() or SetAge(), the this pointer for th
Read tutorialNormally you can access data members and functions by using the dot (.) operator for Cat objects created locally. To access the Cat object on the free store, you must dereference t
Read tutorialThe program below demonstrates allocating a variable on the heap, using that variable, and deleting it.
Read tutorialLocal variables are on the stack, along with function parameters. Code is in code space, of course, and global variables are in global name space. The registers are used for intern
Read tutorialOnce a pointer is assigned the address of a variable, you can use that pointer to access the data in that variable. Program below demonstrates how the address of a local variable i
Read tutorialOne example today. A better developer tomorrow.