Java does not support pointers. NullPointerException is a RuntimeException .Its a special null value can be assigned to an object reference in java. NullPointerException is thrown when an application attempts to use an object reference that has the null value. But, what Java does have is references, which are different from pointers. References store an address. That address is the address in memory of the object. So, when a class is declared like so: "StudentClass s = new StudentClass();", the "s" variable actually stores an address in memory. If you were to look at that address in memory you would see the details of the StudentClass object. Pointers in C++, however, point directly to the object. You can not perform arithmetic operations on references. So, adding 1 to a pointer is not possible, but is possible in C++. | 0 |
By: [email protected] On: Fri Jul 08 15:00:50 IST 2016 0 0 0 | 0 |
Are You Satisfied :0Yes0No |
Java does not support pointers. NullPointerException is a RuntimeException .Its a special null value can be assigned to an object reference in java. NullPointerException is thrown when an application attempts to use an object reference that has the null value. But, what Java does have is references, which are different from pointers. References store an address. That address is the address in memory of the object. So, when a class is declared like so: "StudentClass s = new StudentClass();", the "s" variable actually stores an address in memory. If you were to look at that address in memory you would see the details of the StudentClass object. Pointers in C++, however, point directly to the object. You can not perform arithmetic operations on references. So, adding 1 to a pointer is not possible, but is possible in C++. | 0 |
By: [email protected] On: Fri Jul 08 15:04:01 IST 2016 0 0 0 | 0 |
Are You Satisfied :0Yes0No |