0% found this document useful (0 votes)
506 views4 pages

Question Bank: Java Programming (9113) Class: Tyif (IF/V/C) Chapter No. 05 Applets and Graphics Programming

This document contains review questions, programming exercises, and objective questions about Java applets and graphics programming. It reviews the lifecycle of applets, applet classes and methods, differences between applet and applications, HTML applet tags, graphics drawing methods, and more. It provides 20 review questions, 10 programming exercises, and 10 objective type questions related to applets and graphics in Java.

Uploaded by

api-3728136
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
506 views4 pages

Question Bank: Java Programming (9113) Class: Tyif (IF/V/C) Chapter No. 05 Applets and Graphics Programming

This document contains review questions, programming exercises, and objective questions about Java applets and graphics programming. It reviews the lifecycle of applets, applet classes and methods, differences between applet and applications, HTML applet tags, graphics drawing methods, and more. It provides 20 review questions, 10 programming exercises, and 10 objective type questions related to applets and graphics in Java.

Uploaded by

api-3728136
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

K K Wagh Polytechnic, Nashik – 3

Question Bank : Java Programming (9113)


Class : TYIF (IF/V/C)
Chapter No. 05 Applets and Graphics Programming

Review Questions from previous MSBTE question papers:

1. Explain the life cycle of Applet in detail.


2. Give the hierarchy of Applet class.
3. Describe the methods used in applet skeleton.
4. Give differences between start( ) and init( ) methods of Applet class.
5. Differentiate between application and an applet.
6. Explain the syntax of standard HTML applet tag.
7. State the differences between stop( ) and destroy( ) methods.
8. Why it is necessary to declare the subclass of an Applet class as
public?
9. Explain the operations of paint( ) method. Why it is necessary?
10. Why Java applet does not contain a main( ) method?
11. How to pass parameters to the applet? Illustrate with example.
12. Describe the methods getCodeBase( ) and getDocumentBase( ) with
suitable example.
13. Which are methods related to a Font and Color class? Explain.
14. How to build applet into HTML file?
15. How to connect two applet files to each other? Explain.
16. Illustrate the use of update( ) and repaint( ) with example.
17. Enlist applications of Applet.
18. Explain various methods of Graphics to draw different shapes on the
applet.
19. How to draw a circle using drawOval( ) and drawArc( ) methods?
20. Give and explain different syntax of creating polygons on applet.

Programming Exercises:

1. Create an applet with size 300 X 200 and display “Hello” on it at the
center.
2. Display the numbers from 1 to 10 reversely on the applet.
3. Display a pentagon on the applet filled with green color.
4. Create an applet to display the string “Applet Graphics Programming”
with font “Courier New”, size: 15 points and BOLD + ITALIC.
5. Display different concentric oval shapes on the applet at the center
with different colors.
6. Create an applet with blue background, yellow foreground and display
string “Core Java Programming” with Arial font point size = 20.

By Mr. Kute T. B. for (TYIF) 2008-2009 -1-


K K Wagh Polytechnic, Nashik – 3

7. Accept a date using <param> tag and display along with the message,
“My Birthday is: “.
8. Accept the flower name as parameter and display it along with the
message “It is a beautiful flower”. The HTML file should be placed in
the directory called flower. The background color of this applet is light
gray. The text displayed in Times new roman with 40 points.
9. Input two strings from <param> tag concatenate them and display
them in the status window.
10. Create an applet with background color red and draw a circle at the
middle of applet which if filled with blue color.

Objective questions:

1. In order to cause the paint(Graphics) method to execute, which of the


following is the most appropriate method to call:
a) paint()
b) repaint()
c) paint(Graphics)
d) update(Graphics)
e) None – you should never cause paint(Graphics) to execute

2. Consider the following tags and attributes of tags:


1 CODEBASE
2 ALT
3 NAME
4 CLASS
5 JAVAC
6 HORIZONTALSPACE
7 VERTICALSPACE
8 WIDTH
9 PARAM
10 JAR
Which of the above can be used within the <APPLET> and </APPLET>
tags?
a) line 1, 2, 3
b) line 2, 5, 6, 7
c) line 3, 4, 5
d) line 8, 9, 10
e) line 8, 9

3. Which of the following illustrates the correct way to pass a parameter


into an applet:

a) <applet code=Test.class age=33 width=100 height=100>


b) <param name=age value=33>
c) <applet code=Test.class name=age value=33 width=100
height=100>

By Mr. Kute T. B. for (TYIF) 2008-2009 -2-


K K Wagh Polytechnic, Nashik – 3

d) <applet Test 33>

4. If the following HTML code is used to display the applet in the code
MgAp what will be displayed at the console?
<applet code = “my” height=400 width=400 parameter
HowOld=30 > </applet>
public class my extends Applet{
public void init(){
System.out.println(getParameter("age"));
}
}

5. In which package the Graphics class is defined?


a) java.io
b) java.lang
c) java.applet
d) java.awt

6. showDocument( ) is the method of …


a) Applet
b) Graphics
c) AppletContext
d) DocumentBase

7. Which is the last method called when the applet execution is


completed?
a) paint()
b) sleep()
c) stop()
d) destroy()

8. The Applet is subclass of which class from AWT package?


a) Panel
b) Container
c) Component
d) Frame
e) Window
f) JApplet

9. Which method is used to change the contents of status window?


a) statusWindow()
b) showStatus()
c) showDocument()
d) showWindow()

By Mr. Kute T. B. for (TYIF) 2008-2009 -3-


K K Wagh Polytechnic, Nashik – 3

10. Which of the following color is not available in Java library?


a) Color.vermilion
b) Color.cyan
c) Color.magenta
d) Color.lightGray

By Mr. Kute T. B. for (TYIF) 2008-2009 -4-

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy