The answer to this question is the term virtual memory. A virtual memory is a type of memory that uses a secondary memory which is implemented on hardware and software. A virtual memory maps and combines virtual addresses into a physical address inside the computer memory and operating system controls the memory into virtual memory.
Answer:
int k=0;
for(int i=0;i<=13; i++)
{
if (table[i].getKey().equals(key))
{
k=i;
}
else
{
continue;
}
}
V value= table[k].getValue();
return value;
}
Explanation:
Note table[i] is an entry, and we know the key as it is an argument input to the function. Hence, we find the entry position using the given key, and then find the corresponding value and return it. And this is what is required. There are 14 entries in this hashtable, as known from the question.
// this function will return 1 if the string sent in arguments is palindrome //else it will return 0
int palindrome(int start_of_string, int end_of_string, string &strr)
{
// base case to check if the string is not empty
if (start_of_string>= end_of_string)
return 1;
if (strr[start_of_string] != strr[end_of_string])
return 0;
// recursive call
return palindrome(++start_of_string, --end_of_string, strr);
}
I basically agree with the answer B.
Answer:
Java Applets are used to include java programs on web page.
Explanation:
Java Applets are small java programs that can be run on any browser with appropriate Java Plug-in and displays applet as a section of web page.
How to Create Applet
Create an applet class by extending it with JApplet and add a paint method in it. for example
import java.awt.*;
import javax.swing.*;
public class HelloWorld extends JApplet {
public void paint(Graphics graphic)
{
super.paint(graphic);
}
}
The above code will create an applet and super.paint(graphic) method will draw the applet for you.
In order to display "Hello World" string in applet. you just need to add the following line after super.paint(graphic); method.
graphic.drawString("Hello World" , 20, 20);
Run Code
Click on Run Button and you will able to see the applet in applet viewer window.