Documente Academic
Documente Profesional
Documente Cultură
1. (a) Can you convert a for loop to a while loop? List the advantages of using for
loops
(b) Convert the following for loop statement to a while loop and to a do loop: for
(int i=0;i<=1000;i++) long sum=sum+i; . [8+8]
2. (a) What is an array? Why arrays are easier to use compared to a bunch of related
variables?
(b) Write a program for transposition of a matrix using arraycopy command.
[6+10]
3. Create a base class with two methods. In the first method, call the second method.Inherit
a class and override the second method. Create an object of the derived class, up-
cast it to the base type, and call the first method. Explain what happens. [16]
4. Prove that all the methods in an interface are automatically public. [16]
5. Explain in detail different Array related exceptions with the help of examples.[16]
6. What are the methods supported by KeyListener interface and MouseListener in-
terface. Explain each of them with examples. [8+8]
7. What is meant by AWT? How will you create User Interfaces for applets? [6+10]
?????
1 of 1