Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

How a pointer stores values of an object

Answer»

We can say that pointer is a variable which is used to stores address of other variable.The TECHNIC pointer is used is so simple pointer only stores the first byte of address and then we can FIND upcoming BYTES according to the size of the variable.To understand this we TAKE is example:-
For example if a variable of integer type is being accessed by a pointer. So the pointer will only store the first byte of the address and as integer datatype takes two bytes memory the next byte of address location can be find out by adding 1 to the first byte of the address.

2.

difference in between abstrct classes and interfaces

Answer»

(1)Multiple inheritance
Interface is not a class but a class may inherit several interfaces.
A class may inherit only one abstract class.
(2)Default implementation
Interface not provide any code that is default
abstract class provide default code and/or just the DETAILS that have to be overridden.
(3)Fast
Interface eequires more time to find the actual method in the corresponding classes.
It is very fast in abstract class
(4)Access Modfiers
Interface doesnot have access modifiers for its subs, functions, properties etc everything is assumed as public
Abstract class can contain access modifiers for the subs, functions, properties
(5)Declartion of Fields
Interface cannot defined and fields
Abstract class can have fields and constrants declartion
(6)Peripheral
Interfaces are used to define the peripheral ABILITIES of a class. In other words both Human and Vehicle can inherit from a IMovable interface.
An abstract class defines the core identity of a class and there it is used for objects of the same type.
(7)Homogeneity
Interface is suitable where VARIOUS implementations only share method signatures
If various implementations are of the same kind and use common behaviour or STATUS then abstract class is better to use.
(8)New Method
If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method.
If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly.

3.

Datatype of pointer and how to handle it in 32,64 bit computer

Answer»

We can say that Pointer can be of any datatype and is not RESTRICTED to the size of that particular datatype. Pointer is a contains 4byte VARIABLE of address in a 32 bit computer are of 4 byte length. So what about 64 bit computers? Well in 64 bit computers the pointer size will vary, but if we rum a 32 bit pointer in 64 bit system then we will FIND half of the pointer's field is empty LIKE 0x000000.