Answer:
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args)
{
Stack<Integer> mat=new Stack<Integer>();
mat.add(1);
mat.add(3);
mat.add(6);
System.out.println(mat);
Object [] a=mat.toArray();
for(int i=0;i<a.length;i++)
System.out.println(a[i]);
}
}
Explanation:
An integer type stack st is created;
1,3 and 6 are added to the stack.
printing the contents of the stack.
array a is created form the stack using toArray().
Then printing the array.
Answer:
c) 10.
Explanation:
The script will return 10 after the user enters 5 at both prompts.In the script we have three variables firstNumber,secondNumberand thirdNumber.Where the user is entering the values in the firstNumber and the secondNumber and thirdNumber stores the sum of firsNumber and secondNumber and after that it writes on the web page using the document.write.
Answer:
Airplanes, Telephones, Ships, Pens