CS-74: INTRODUCTION TO INTERNET PROGRAMMING
(JAVA, ACTIVE X)
Time: 3 hours Maximum Marks: 75
Note: Question 1 is compulsory. Attempt any three from the rest.
1. (i) Write a complete Java program to fond out whether the string T1 us contained in the string t. If so, it returns the offset of the first march. If not, it returms-1 [10]
(ii) Answer the following questions:
(a) What is the relationship between Java and HTML? [04]
(b) What happens when your program attempts to access an array element with an invalid index? [03]
(c) How do you set colours and fonts in a graphics context? How do you find the current colour and font style? [03]
(d) Describe the paint ( ) method. Where is it defined? How is it invoked? [05]
(e) Comment on “Java is a robust programming language? [05]
2. Different between the following: [15]
(a) This and Super
(b) Construction and Methods
(c) Final and Abstract
(d) Window and Panel
(e) Thread and Process
3. Define the following terms: [15]
(i) Data encapsulation
(ii) Methods overloading and overriding a method
(iii) Border Layout Manager
(iv) Exception handling features in Java
(v) Security features in Java programming
4. (i) In an object oriented traffic simulation system, we have the following classes: [10]
- Vehicle
- Car
- Truck
- Pickup truck
- Sport utility vehicle
- Mini van
- Bicycle
- Motorcycle
Draw an inheritance diagram the shows the relationship between these classes. identify methods, variables in each class.
(ii) Describe the init ( ), start ( ), stop ( ), and destroy ( ) methods in the applet class. [05]
5. (i) Write a recursive program in Java for the greatest common divisor (GCD). Given two positive integers, the GCD is the largest integer that divides them both. [10]
(ii) Answer the following questions?
(a) How do you run an applet? [03]
(b) How do you create a button labeled ‘BCA’? How do you change a label on a button? [02]
6. Answer the following questions.
(i) What is the keyboard “throw” used for? [05]
(ii) What is the Java virtual machine? [05]
(iii) What is the difference between radio buttons and check boxes? [02]
(iv) What is the difference between a menu, menu bar and menu item? [03]
No comments:
Post a Comment