Answer:
Register-it contains all the instructions that are present in the processor.
Memory location- it is the particular memory address where the data is stored.
Explanation: Difference between register and memory location are as follows :-
- Register are the found in the CPU internal storage and memory location is present on the RAM.
- Registers are faster in movement as compared to the memory location.
- Register has the capacity of holding of less data as compared to the memory location which can store data in large amount .
Answer:
word = input('Enter a single word: ', 's');
n = length(word);
nodupWord = [];
for i = 1:n
dup = false;
c = word(i);
for j = 1:i-1
if word(j) == c
dup = true;
break;
end
end
if ~dup
nodupWord = [nodupWord, c]; %add the non-duplicate char to end
end
end
disp(['Adjusted word: ', nodupWord])
Explanation:
The code is in Python.
Answer:
(3) option is the correct answer.
Explanation:
Constructors need to initialize the object in the memory. "To declare the Constructor for any class the user needs to specify the constructor name which is already the class name". This is an object-oriented language guideline.
It is because the object is created by the name of the class and Constructor is used to allocate the memory for the object. hence Constructor is created by the name of the class.
For example--
class test //class name test
{
test() //created a constructor with class name "test"
{
}
}
In the above example class name and constructor name are same if it not then it will gives a error.
Another option is not valid for the answer to the above problem because-
- Option 1 is wrong because, for any class, the data member is a type of variable, which is used to store the data and is accessed with the help of an object.
- Option 2 is wrong because, for any class, member function is a type of user function used to accessed the variable and expressions.
- Option 4 is wrong because, package is a set used to hold classes and interfaces.