Level 187 Level 189
34 words 0 ignored
Ready to learn Ready to review
Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.
What is an Applet?
A java applet is program that can be included in a HTML page and be executed in a java enabled client browser. Applets are used for creating dynamic and interactive web applications.
Explain the life cycle of an Applet.
An applet may undergo the following states:
What happens when an applet is loaded?
First of all, an instance of the applet's controlling class is created. Then, the applet initializes itself and finally, it starts running.
What is the difference between an Applet and a Java Application?
Applets are executed within a java enabled browser, but a Java application is a standalone Java program that can be executed outside of a browser. However, they both require the existence of a Java Vir…
What are the restrictions imposed on Java applets?
Mostly due to security reasons, the following restrictions are imposed on Java applets:
What are untrusted applets?
Untrusted applets are those Java applets that cannot access or execute local system files. By default, all downloaded applets are considered as untrusted.
What is the difference between applets loaded over the internet and applets loaded via the file system?
Regarding the case where an applet is loaded over the internet, the applet is loaded by the applet classloader and is subject to the restrictions enforced by the applet security manager. Regarding the case w…
What is the applet class loader, and what does it provide?
When an applet is loaded over the internet, the applet is loaded by the applet classloader. The class loader enforces the Java name space hierarchy. Also, the class loader guarantees that a unique namespace ex…
What is the applet security manager, and what does it provide?
The applet security manager is a mechanism to impose restrictions on Java applets. A browser may only have one security manager. The security manager is established at startup, and it cannot thereafter be replaced, overloaded, overridden, or extended.
* Package statement
What are the components of a Java class file?
The first statement of the class file
If a class includes a package statement, where must it be placed?
T/F Strings are objects of the class String.
* Access modifiers
What is contained in the definition of a class?
State is defined through the instance variables or attributes
How is the state and behavior of a Java class defined?
In a for loop, the control variable can only be incremented.
True or False: Classes and interfaces defined in the same source code file can be defined in different packages.
False. Only one package statment is allowed per source code file and it applies to all contained classes or interfaces.
What is an executable class?
An executable Java class is a class that, when handed over to the Java Virtual Machine (JVM), starts its execution at a particular point in the class.
What are the four Java access modifiers and their characteristics?
The public access modifier is the least restrictive access modifier.
abstract, final, and static.
What are the three non-access modifiers covered in the OCA exam?
What are the characteristics of an abstract class?
The abstract keyword, when prefixed to the definition of a concrete class, can change it to an abstract class, even if it doesn't define any abstract methods.
What are the characteristics of an abstract interface?
An interface is an abstract entity by default. The Java compiler automatically adds the keyword abstract to the definition of an interface (which
What are the characteristics of an abstract method?
An abstract method doesn't have a body, which means it's implemented by the class that extends the class defining the abstract method. The abstract method
classes, methods, and variables
What components can the final modifier be applied to?
It can not be extended by another class.
What does it mean if a class is marked as final?
What does it mean for a method to be marked as final?
A final method defined in a base class can't be overridden by a derived class.
What is the definiton of an overriden method?
Overridden methods are defined by classes and interfaces that share inheritance relationships.
What does it mean if a variable is marked as final?
A final variable can't be reassigned a value. It can be assigned a value only once.
What components can the static modifer be applied to?
The static modifier can be applied to inner classes, inner interfaces, variables, and methods. Inner classes and interfaces aren't covered in this exam.
What are some of the characteristics of static variables and methods?
static attributes (fields and methods) are common to all instances of a class and aren't unique to any instance of a class.
arg = "1+2"
java myApp 1+2 2*3
Define a class called MyClass that extends MySuperclass and implements Yourinterface.
What are the rules for valid class names
Same as for identifiers, except keywords can be used for class names.
Can you define instance and static variables with the same name?
False. Private members become eligible for garbage collection as soon as there are no references pointing to them.
Private members of a class become eligible for garbage collection only when their containing object is no longer referenced.