Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

HELP!! A marker annotation is: One that does not take multiple arguments. One th

ID: 3809041 • Letter: H

Question

HELP!!

A marker annotation is:

One that does not take multiple arguments.

One that does not take any arguments.
One that does take only two arguments

One that does take any number of arguments

An annotation can be applied only to methods..

True or false?

@Override

public String toString()

{

Return String.format(“%s: %s %s %s: %s %s: %.2f %s: %.2f”, “commission employee”,      

firstName, lastName, “social security number”, socialSecurityNumber, “gross sales”, grossSales, “commission rate”, commissionRate);

} //end method toString

@Override annotation is used to indicate that method toString should override a subclass method.

@Override annotation is used to indicate that method toString should overload a subclass method.

@Override annotation is used to indicate that method toString should overload a superclass method

@Override annotation is used to indicate that method toString should override a superclass method.

What method is called when an applet first begins running?

initialize()

start()

init()

main()


What method is called when an applet is removed from the system?

remove()

destruct()

delete()

destroy()

Which method is invoked for an applet each time a browser’s user leaves an HTML page on which the applet resides?

Complete

End

Stop

Destroy

Every applet should extend class:

Applet

JApplet

Applet and JApplet

Applet or JApplet

Which of the followings can be used to execute a Java applet?

appletviewer or a browser

appletviewer or a compiler

a browser or a compiler

any of the above

What method is invoked to draw on an applet:

Init

Paint

Start

The HTML tags that we use to specify that an applet should be loaded into an applet container and executed.

<applet> , </applet>

<load>, </load>

<body>, </body>

<html>, </html>

Explanation / Answer

A marker annotation is:

Answer: One that does not take any arguments.

An annotation can be applied only to methods..

Answer: false. An annotaton can be applied to the classes, interfaces, methods and fields..

@Override

public String toString()

{

Return String.format(“%s: %s %s %s: %s %s: %.2f %s: %.2f”, “commission employee”,      

firstName, lastName, “social security number”, socialSecurityNumber, “gross sales”, grossSales, “commission rate”, commissionRate);

} //end method toString

Answer: @Override annotation is used to indicate that method toString should override a superclass method.

What method is called when an applet first begins running?

Answer: init()

What method is called when an applet is removed from the system?

Answer: destroy()

Which method is invoked for an applet each time a browser’s user leaves an HTML page on which the applet resides

Answer: stop()

Every applet should extend class:

Anwer: Applet or JApplet

Which of the followings can be used to execute a Java applet?

Answer: appletviewer or a browser

What method is invoked to draw on an applet:

Answer: Paint

The HTML tags that we use to specify that an applet should be loaded into an applet container and executed.

Answer: <applet> , </applet>