File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Applet" Watch "Applet" New topic


rajani adapa
Ranch Hand

Joined: Jan 24, 2001
Posts: 54
import java.applet.Applet;
import java.awt.*;

public class Sample extends Applet {
private String text = "Hello World";
public void init() {
add(new Label(text));
public Sample (String string) {
text = string;

It is accessed form the following HTML page:

<title>Sample Applet</title>
<applet code="Sample.class" width=200 height=200></applet>

What is the answer to this question?
and tell me why?
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
what is the question exactly ? also your method must have a return type of Sample , and how can i attach example files ?

Val SCJP <BR>going for SCJD
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi Rajani,
Read Carl's answer in this earlier post on the same subject.
Hope that helps.
Jane Griscti
Sun Certified Java 2 Programmer
"When ideas fail, words come in very handy" -- Goethe

Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
I agree. Here's the link:
subject: Applet
It's not a secret anymore!