You are on page 1of 21

Elective 4 – Advance Java Programming

Topic Questions

prelim
Chapter 1: Introductin to Java
1. What is Java? 1. It is a blueprint that defines that defines the
variables and the methods common to all
object of a certain kind.
A. Class
B. Object
C. Instance Variable
D. Instance Method
2. It is an item of date named by an identifier.
A. Class
B. Variable
C. Instance Variable
D. Instance Method
3. It is any item of data that is associated with a
particular object.
A. Class
B. Object
C. Instance Variable
D. Instance Method

4. It is a function defined in a class.


A. Class
B. Object
C. Instance Variable
D. Instance Method
5. It is a programming unit consisting of data
2. Fundamentals of Object Oriented and functionality. It is the key to
Programming understanding object oriented technology.
A. Class
B. Object
C. Instance Variable
D. Instance Method
6. It forces the user to use an interface to access
data. it is usually hides the implementation

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

details of a class to make codes more


maintainable.
A. Encapsulation
B. Polymorphism
C. Interface
D. Inheritance
7. This clause is used when a method that raises
an exception does not handle the exception.
A. Exception
B. Error
C. throws
D. Throws exception
8. It is basically used for cleaning up purposes,
such as closing files and releasing resources.
A. try
B. catch
C. throws
D. finally
9. This handle a particular exception, place of
code, which when it is invoked it throws an
exception.
A. try
B. catch
C. throws
D. finally
10. It creates a list of adjoining blocks, one for
each possible exception that can be thrown.
A. try
B. catch
C. throws
D. finally
11. It is used to define the common attributes
and generic behavior of a group of classes.
A. Encapsulation
B. Polymorphism
C. Abstract
D. Inheritance
12. It is used with a class to indicate that the class
cannot be instantiated.
A. Abstract modifier
B. Modifier Abstract
C. Abstract Class
D. Class Abstract

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

13. It specifies the prototype or behavior of a


class.
A. Encapsulation
B. Polymorphism
C. Interface
D. Inheritance
14. This keyword is used in java to fully utilize the
multiple methods it is an aspect of
polymorphism.
A. extends
B. interface
C. this
D. return
15. It is an object that groups multiple elements
into a single unit.
A. Encapsulation
B. Collection
C. Interface
D. Inheritance
16. This interface do not allow duplicate
elements
A. Set interface
B. Get interface
C. List interface
D. Interface Set
17. This interface the elements are ordered as on
a list.
A. Set interface
B. Get interface
C. List interface
D. Interface Set
18. It serves the same purpose as an array,
except that it can change length while the
program is running.
A. Two Dimensional Array
B. Single Array
C. Jagged Array
D. ArrayList
19. This method is used to set an element for the
first time in an ArrayList.
A. add()
B. set()
C. get()
D. adding()

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

20. What is the correct syntax in declaring an


Accessor?
A. private float getBalance();
B. Private float GetBalance()
C. PRIVATE FLOAT GETBALANCE();
D. Private FLOAT getbalance();
21. What is the correct syntax in declaring a
Mutator?
A. Public void setWeight(int
newWeight)
B. Public void SETweight(int new
Weight)
C. public void setWeight(int
newWeight)
D. PUBLIC void SETWEIGHT(int NEW
weight)
22. Base on the following code fragments what is
the best that will describe the inheritance?
A. Public class A extends B
B. public class B extends A
C. public Class B extends A
D. Public Class A EXTENDS B
23. Base on the following code fragment what is
the best that will describe the Instantiated
object?
A. Concrete c = new Concrete();
B. Concrete c = newConcrete();
C. Concrete c = New Concrete();
D. Concrete c = new Concrete()
24. Base on the following code fragment what is
the best that will describe the Interface
object?
A. Public interface CALLBACK
B. Public class interface CALLBACK
C. public class interface CALLBACK
D. public interface CALLBACK
25. Based on the following code fragment what
is the best that will describe the ArrayList
constructor?
A. ArrayList aList = new ArrayList();
B. arrayist aList = new ArrayList();
C. Array List aList = new Array List();
D. Arraylist aList = new Arraylist();

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

26. Base on the following code fragment what is


the best that will describe the Constructor
declaration?
A. Private int weight;

Public Dog()
{
Weight = 42;
}
B. private new weight;
Public Dog()
{
Weight = Weight;
}

C. private int weight;


public Dog()
{
weight = 42;
}
D. Private int weight;
Public Dog()
{
Weight = Dog()
}
27. Which of the following statement is correct
about Accessor Method?
A. It is used to declare a variable that
will access the data
B. It is used to accept the entity that
will be produced by the mutator
method
C. It is used to mutate the entity to a
new stated form
D. None of the above
28. Which of the following statement is correct
about Mutator Method?
A. It is used to instantiate an object
B. It is used to get a value from accessor
method
C. It is used to mutate an entity and
distribute it to accessor method
D. None of the above

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

29. Which of the following statement is correct


about Inheritance?
A. It is the backbone of object oriented
programming
B. It is the foundation of the object
oriented programming
C. It is the backbone of java
programming
D. None of the above
30. Which of the following statement is correct
about Encapsulation?
A. It hides the implementation details
of a class
B. It forces the user to use an interface
to access data
C. It makes the code more maintainable
D. All of the Above
31. Which of the following statement is correct
about Objects?
A. Each object is a programming unit
consisting of Instance Variable and
Instance method
B. Each object is a programming unit
consisting of data and functionality
C. A is only the statement which is
correct
D. A and B is correct
32. Which of the following code fragments that
will best describe the Interface object?
A. public interface CallBack
{
Void callBack(int param);
}
public class Client implements
Callback
{
public void callback(int p)
{
Systemt.out.println(“Callba
ck called with “ + p);
}
}
B. Public Class interface CallBack
{

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

Void callBack(int param);


}
Public class Client implements
Callback
{
public void callback(int p)
{
Systemt.out.println(“Callbac
k called with “ + p);
}
}
C. public void interface CallBack
{
Void callBack(int param);
}
Public class Client implements
Callback
{
public void callback(int p)
{
Systemt.out.println(“Callbac
k called with “ + p);
}
}
D. public interface CallBack
{
Void callBack(int param);
}
public class Client extends Callback
{
public void callback(int p)
{
Systemt.out.println(“Callbac
k called with “ + p);
}
}
33. Which of the following statement is true in
using Instance Variable?
A. It is only a storage that will handle a
value
B. It is always declared outside of any
method
C. A is only true
D. None of the above is true

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

34. Which of the following statement is true in


using abstract method?
A. It is used for object oriented program
B. It is used for declaring functions
C. It must be declared inside an
abstract class
D. It must be declared inside a class
35. Which of the following statement is true
about declaring a Method Overloading?
A. the method name is all the same but
in different in arguments or
parameters and return types
B. the method name is different to
others having a same arguments or
parameters and return types
C. the method name is having multiple
method name, arguments or
parameters and return types
D. None of the above is true
E. It is an object that groups multiple
elements into a single unit
F. It is an object that group in a single
element into a single unit
G. It is an object that group in a two
element into a single unit
H. It is an object that group in a single
element into two units
36. Which of the following is true about
ArrayList?
A. It cannot change its length while the
program is running
B. It can change its length after the
program runs
C. It can change length while the
program is running
D. None of the above is true
37. Which of the following is true about instance
method?
A. It is a function defined in a class
B. It is a process defined in a class
C. It is a function not defined in a class
D. It is a function not defined in a class
38. Which of the following statement is true
about Polymorphism

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

A. It came from the Greek word poly


meaning having multiple forms
B. It has the ability to have many
different forms
C. It has the characteristics of being
able to assign a different meaning or
usage
D. All of the above
39. Which of the following statement is true
about try block?
A. The try block execute its condition
first before throwing into an
exception
B. The try block throw the condition
first into an exception before it is
executed
C. The try block will only try to execute
the condition
D. None of the above is true

40. Which of the following statement is true


about catch block?
A. The catch block will process first
before the try block
B. The catch block handles the
exception handling and catch the
executed condition to the try block
C. A is correct
D. None of the above
41. Which of the following statement is correct
about finally block?
3. Java Evolution A. It can be added at the end of all
blocks
B. It is basically used for cleaning up
purposes
C. Is executed after the execution of all
catch blocks
D. All of the above
42. Which of the following statement is correct
about abstract class?
A. It is used to define the generic
characteristics of an abstract
concept

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

B. It is used to define the common


attributes and generic behavior of a
group of classes
C. Any class with one or more abstract
methods
D. All of the above
43. Which of the following statement is correct
about collection interface?
A. The root of the collection hierarchy
B. The least common denominator that
all collection implement
C. It is use to pass collection objects
around and to manipulate them
when maximum generality is desired
D. All of the above

44. If the abstract class named as “Abstract”


serves as the parent class and handles the
m1.() and it is also inherited by a class named
as “Concrete” what on the following code
fragment below describes the instantiation
object of an abstract class?
A. concrete c = new Concrete();
abstract abstractReference = c;
abstractReference.m1();
B. Concrete c = new Concrete();
Abstract abstractReference = c;
abstractReference.m1();
Chapter 2: Java Applet; The Java
C. Concrete c = new Abstract();
Development Kit (JDK)
Concrete abstractReference = c;
abstractReference.m1();
D. Concrete c = new Concrete();
Abstract Concrete = c;
Concrete.m1();
45. What is the keyword used in inheritance?
A. Inherit
B. Get
C. Extending
D. extends
46. Which of the following is true about
Collection object?

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

A. It is an object that groups multiple


elements into a single unit
B. It is an object that group in a single
element into a single unit
C. It is an object that group in a two
element into a single unit

1. HTML in 10 minutes
2. Applet: Hello World Program

Chapter 3: Exception Handling


3.1. Checked Exceptions
47. Which of the following statement is true
about try block?
A. The try block execute its condition
first before throwing into an
exception
B. The try block throw the condition
first into an exception before it is
executed
C. The try block will only try to execute
the condition
D. None of the above is true
48. Which of the following statement is true
about catch block?
A. The catch block will process first
before the try block
3.2. Runtime Exceptions B. The catch block handles the
exception handling and catch the
executed condition to the try block
C. A is correct
D. None of the above
49. Which of the following statement is correct
about finally block?
A. It can be added at the end of all
blocks
B. It is basically used for cleaning up
purposes
C. Is executed after the execution of all
catch blocks
D. All of the above
50. Which of the following statement is correct
about abstract class?

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

A. It is used to define the generic


characteristics of an abstract
concept
B. It is used to define the common
attributes and generic behavior of a
group of classes
C. Any class with one or more abstract
methods
D. All of the above

3.3. Error

Chapter 4: Graphical User Interface (GUI)


4.1. Graphical User Interface (GUI)
4.1 Swing Components
4.1.1 Jlablel
4.1.2 JTextField
4.1.3 Jbutton
4.1.4 JRadioButton
4.1.5 JCheckBox
4.1.6 JTextArea

Midterm
Chapter 5: Multithreading
5.1 Multiple thread eacting on single object
5.2 Synchronization
5.3 Thread Group
5.4 Thread Priorities
5.5 Daemon Thread

Chapter 6: Networking
6.1Internet Addressing
6.2 InetAddress
6.3 Factory Methods
6.4 Instance Methods
6.5 TCP/IP Server Sockets
6.6 Client Sockets, URL, URL Connection
6.7 TCP/IP Server Sockets
6.8 Datagrams
Chapter 7: Enterprise Java Bean

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

7.1 Preparing a Class to be a JavaBean


7.2 Java Bean Properties 1. It is a mechanism that permits a user to
invoke a program on the Web server.
a. Common Gateway Interface
b. Servlet
c. Gateway
d. Common Interface Gateway
2. It is a java technology program that like CGI
program runs on the server
a. Servlet
b. Common Gateway Interface
c. Applet
d. APK
3. These codes are informational they indicate
that the request is currently being processed
a. 100-111
b. 100-199
c. 200-300
d. 400-500
4. These codes denote success that the web
server received and carried the request
successful
a. 100-111
b. 100-199
c. 200-299
d. 400-500
5. These codes indicate that the request hasn’t
been performed, because the information
required has been moved
a. 100-111
b. 100-199
c. 200-300
d. 300-399
6. These codes denote a client error that the
request was incomplete, incorrect, or
impossible
a. 400-499
b. 100-199
c. 200-300
d. 400-500
7. These codes denote a server error that the
request appeared to be valid, but that the
server failed to carry it out
a. 100-111
b. 100-199
c. 500-599
d. 400-500

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

8. It contains the HTML code together with any


script that is to be executed by the browser
a. Http Response Body
b. Http Request Body
c. Http Body
d. Request Body
9. It is a single line fields for typing text into
a. Textbox
b. Text Area
c. Radio Button
d. Checkbox
10. It is a multiple line boxes for typing text info
a. Textbox
b. Text Area
c. Radio Button
d. Checkbox
11. These buttons are multiple choice buttons
that allows only one mutually exclusive
answer
a. Textbox
b. Text Area
c. Radio Button
d. Checkbox

12. These boxes are single and multiple choice


buttons that allow several, independent
a. Textbox
b. Text Area
c. Radio Button
d. Checkbox
13. These boxes are buttons which reveal a drop
down menu from which you’re allowed to
select one or more options
a. Listbox
b. Text Area
c. Radio Button
d. Checkbox
14. These buttons transfer HTML forms to the
web server
a. Textbox
b. Submit button
c. Radio Button
d. Checkbox
15. These buttons change the contents of an
HTML form that hasn’t already been
submitted
a. Textbox
b. Text Area

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

c. Reset Button
d. Checkbox
16. These buttons trigger whatever event they
are connected to
a. Textbox
b. Text Area
c. Radio Button
d. Normal Button
17. These fields are like text boxes, but with one
important difference anything you type into
them is disguised by an asterisks
a. Password Fields
b. Text Area
c. Radio Button
d. Checkbox
18. These fields are set in the HTML and are sent
along with other form data
a. Hidden Fields
b. Text Area
c. Radio Button
d. Checkbox
19. These method sends the form data to the
web server
a. Http Post
b. Http Get
c. Post Http
d. Get Http
20. These method is used to retrieve a single
form parameter.
a. getParameterValues()
b. getParameterParameter()
c. getparameterName()
d. getNameParameter()
21. These method is used to retrieve a list of
form values
a. getParameterValues()
b. getParameterParameter()
c. getparameterName()
d. getNameParameter()
22. These method is used to retrieve a full list of
all parameter names submitted by the user
a. getParameterValues()
b. getParameterParameter()
c. getparameterName()
d. getNameParameter()
23. It is a web application that has a unique
context root
a. Deployment Descriptor

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

b. HTTP
c. Root Context
d. Context Root
24. It is a file containing deployment information
a. Deployment Descriptor
b. HTTP
c. Root Context
d. Context Root
25. It is known as a stateless protocol that passed
message from the browser to the web server
asking for a particular web page
a. Deployment Descriptor
b. HTTP
c. Root Context
d. Context Root

Chapter 8: Java Database Connectivity


8.1 Merging data from Multiple Tables
8.2 Joining
8.3 Manipulation

Finals
Chapter 9: Servlets
9.1 Servlet Interaction & Advance Servlet
1. It is used to access a specific application

a. Context
b. Context Root
c. Root Context
d. Root

2. Which of the following URL is the general syntax


of a servlet web application
9.2 Life cycle of Servlet
a. http://host/context/path/file
b. http://host:port/context/path/file
c. http://port/context/path/filed
d. http://host:port/context/file

3. This static files are stored in the top level


directory of the Web application

a. JAR

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

b. WEB-INF
c. HTML
d. JSP

4. This method is called by the web container when


the servlet instance is first created

a. Get()
b. Set()
c. Int()
d. Init()

5. This method is called by the web container when


the servlet instance is being destroyed

a. Destroy()
b. Init()
c. Service()
d. Get()

6. This method is called by the web container to


process a user request

a. Destroy()
b. Init()
c. Service()
d. Get()

7. This method is used by the context initialization


parameter to access the method on the
ServletContext object

a. getInitParameter()
b. InitParameter()
c. getParameter()
d. IntiGetParameter()

8. This element tag is used to configure the


parameters in the deployment descriptor

a. Context-param
b. Context-Parameter
c. Parameter-Context
d. Param-Con

9.3 Java Servlet Development Kit


9.4 Javax.servlet Parameters

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

9.5 Reading Servlet Parameters


9.6 Reading Initialization Parameters
9.7 The javax.servlet.http Package
9.8 Handling HTTP

Chapter 10: JavaServer Pages (JSP)


9. It enables you to write a standard HTML pages
containing tags that run powerful programs based
on the Java programming language

a. Servlet
b. HTML
c. Ajax
d. JSP

10. This phase is used to gets the translated into a


servlet code

a. Compile phase
b. Execution phase
c. Translation phase
d. Running phase

11. This phase is used where the servlet code gets


compiled

10.1 JSP Technologies a. Compile phase


b. Execution phase
c. Translation phase
d. Running phase

12. This phase is used by the servlet that serves as


client requests

a. Compile phase
b. Execution phase
c. Translation phase
d. Running phase

13. What is the status code used by the Web


browser that indicates a Bad Request

a. 400
b. 401
c. 404
d. 405

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

14. What is the status code used by the Web


browser that indicates a page is Not Found

a. 400
b. 401
c. 404
d. 405

15. What is the status code used by the Web


browser that indicates a Method is Not Allowed

a. 400
b. 401
c. 404
d. 405

15. What is the status code used by the Web


browser that indicates a process is Unauthorized

a. 400
b. 401
c. 404
d. 405

16. What is the status code used by the Web


browser that indicates an Unsupported Media Type

a. 415
b. 500
c. 501
d. 503

17. What is the status code used by the Web


browser that indicates an Internal Server Error

a. 415
b. 500
c. 501
d. 503

18. What is the status code used by the Web


browser that indicates that a process is Not
Implemented

a. 415
b. 500
c. 501
d. 503

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

19. What is the status code used by the Web


browser that indicates that a Service is Unavailable

a. 415
b. 500
c. 501
d. 503

20. This clause is used when a method that raises an


exception does not handle the exception.

E. Exception
F. Error
G. throws
H. Throws exception
21. It is basically used for cleaning up purposes, such
as closing files and releasing resources.
a. try
b. catch
c. throws
d. finally

10.2 Configuring the JSP Server


10.3 Handling JSP Errors
10.4 JSP Translation Time Errors
10.5 JSP Request Time Errors

22. Which of the following statement is correct


about Inheritance?
a. It is the backbone of object oriented
programming
b. It is the foundation of the object oriented
programming
c. It is the backbone of java programming
Chapter 11: Introduction Smart Phone d. None of the above
Application 23. Which of the following statement is correct
about Encapsulation?
a. It hides the implementation details of a
class
b. It forces the user to use an interface to
access data
c. It makes the code more maintainable
d. All of the Above

Sir Christopher Lee C. Villablanca


Elective 4 – Advance Java Programming

24. Which of the following statement is correct


about Objects?
a. Each object is a programming unit
consisting of Instance Variable and
Instance method
b. Each object is a programming unit
consisting of data and functionality
c. A is only the statement which is correct
d. A and B is correct

11.1 Introduction to android platform


25. It is a mechanism that permits a user to invoke a
program on the Web server.
a. Common Gateway Interface
11.2 Adding Activity b. Servlet
c. Gateway
d. Common Interface Gateway

11.3 intent
11.4 Services to application
11.5 Using Google map API

Sir Christopher Lee C. Villablanca