Ajp-Qb
Ajp-Qb
Q Topic Question or
No No Topic Name Level Marks Question Options or Option i Option ii Option iii Option iv Answer Key
both
1 1 Introduction to Abstract Windowing Toolkit(AWT) & Swings R 1 What is API Application Programming Interchange Application Programming Intraction Application Programming Interface None Of These Application Programming Interface
Specific Objective
-To design & develop Graphical user interface (GUI)
programs using AWT and swing component.
2 -To arrange the GUI components using different layout R 1 Which of the following is false about GridbagLayout gridx gridy ipadx widthx widthx
managers.
1.1 Component, container, window, frame, panel.
3 1.2 Creating windowed programs & applets. R 1 which of these methods use in cardlayout add(Component C, String s) add(Component C) add(Card c1, Component c) add(String s, Component c) add(String s, Component c)
1.3 AWT controls & layout managers
Understanding the use of AWT controls: labels, buttons,
checkbox, checkbox group, scroll bars, text field, text area
4 Understanding the use of layout managers: flowLayout, R 1 _____________________ is not a Swing Component ButtonGroup Jlabel Jbutton CheckboxGroup CheckboxGroup
borderLayout, gridLayout, cardLayout, gridbagLayout,
menubars, menus, dialog boxes, file dialog.
1.4 Introduction to swing
5 Swing features, MVC Architecture, Combo Boxes, progress bar, R 1 JCheckBox is _______________________Component lightweight heavyweight awt abstract lightweight
tool tips, seperator, tables, trees, toggle button.
7 R 1 whichof the following is not in AWT package ButtonGroup CheckBoxGroup CheckBox Button ButtonGroup
9 2 Event Handling R 1 Which of these not a constants defined in ComponentEvent class? COMPONENT_HIDDEN COMPONENT_SHOWN COMPONENT_SIZED COMPONENT_RESIZED COMPONENT_SIZED
Specific Objective
-To write event driven programs using the delegation
event
model.
-To write programs using adapter classes & the inner
classes.
2.1 The delegation Event Model
Event sources, Event listeners, Event classes. The Action
Event
10 class, The Component Event class, the Container Event class, R 1 KeyListener interface has got _______________methods 2 4 1 3 3
the
Focus Event class, the Item Event class, the Key Event class,
the
Mouse Event class, the Text Event class, the Window Event
class.
2.2 Adapter classes
2.3 Inner classes
2.4 Event listener interfaces
The ActionListener Interface, the ComponentListener
Interface,
11 the ContainerListener Interface, the FocusListener Interface, R 1 Which of these a AdapterClass KeyAdapter class TextAdapter class ActionAdapter class ItemAdapter class KeyAdapter class
the
ItemListener Interface, the KeyListener Interface, the
MouseListener
Interface, the MouseMotion Interface, the
TextListener Interface, the WindowsListener Interface, the
WindowFocusListener Interface
12 R 1 ___________________class is a super class of all event class AWTEvent class Event class EventObject class AWTObject class EventObject class
13 3 Networking & Security R 1 Which of these is a factory methods getAddress() getHostName() getLocalHost() getHostAddress() getLocalHost()
Specific Objective:
-To learn the Java’s built in support for network
programming.
- To write program to demonstrate connectivity through
software SOCKETS, TCP, ISP, URL and the Java security
package.
3.1 Basics of Networking
Socket, IP, TCP, UDP, Proxy Server, Internet Addressing
14 3.2 The InetAddress Class R 1 Which of these is a return type of getData method of DatagramPacket class Object String byte metadata byte
Factory methods
Instance methods
3.3 TCP/IP Sockets
Socket, Server Socket, methods
3.4 URL
URL Connection, http, URL Connection methods,
creating &
using TCP/IP client & server
15 3.5 Security with Java: Theoretical introduction to java.security R 1 __________is class used for accessing the attribute of a remote resource. URL Class URLConnection Class Connection Class ConnectionUrl Class URLConnection Class
Package
Permission class
Policy class
16 R 1 How many ports are reserves by TCP/IP 1000 1024 24 124 1024
17 4 Interacting with Database R 1 forName is a_______________________type method final static abstract super static
Specific Objective :
- To create database driven business applications using
the database API’S two tier and three tier models and the
Java.Sql package
18 4.1 JDBC, ODBC, & Other APIS R 1 For execution of INSERT SQL query in JDBC, ............. method must be used. executeQuery() executeDeleteQuery() executeUpdate() executeDelete() executeUpdate()
JDBC two tier & three tier models
4.2 Connecting to Database
Driver Interface, Driver Manager class, Connection
19 Interface, Statement Interface, the java.sql.package R 1 prepareStatement method is from which class PreparedStatement class PrepareStatement class Connection Class Statement Class Connection Class
Establishing connection & retrieving information Resultset
interface.
20 R 1 which are above use "middle-tier" Three-Tier Foure-Tier n-Tier All of above All of above
21 5 Servlets & JSP R 1 _________is Known as JSP Java Server Page Java Server Program Java Sevlet Page Java Sevlet Program Java Server Page
Specific Objectives :
- To write web based applications using servlets, JSP and
Java Beans.
- To write servlet for cookies and session tracking.
22 5.1 Servlet R 1 How many variablescan be set in JSP programs 3 6 8 None Of These 6
Type of Servlet, Servlet life cycle.
5.2 Using servlets, response redirection.
5.3 Basic concepts of sessions, cookies & session tracking
5.4 Introduction to servlet chaining & filters, Introduction to
23 applet servlet communication. R 1 Which is interface of following Servlet GenericServlet ServletInputStream HttpServlet Servlet
5.5 JSP, expression, directives& declarations,
Life cycle of a JSP page TLD & JSTL, Java beans.
24 R 1 Tomcat is a _____________ Servlet Web Server mail Server File Server Web Server
25 1 Introduction to Abstract Windowing Toolkit(AWT) & Swings U 2 Which method is use to display menubar addMenubar() setMenubar() addMenuBar(MenuBar mb) setMenuBar(MenuBar mb) setMenuBar(MenuBar mb)
Specific Objective
-To design & develop Graphical user interface (GUI)
programs using AWT and swing component.
-To arrange the GUI components using different layout
managers.
1.1 Component, container, window, frame, panel.
1.2 Creating windowed programs & applets.
1.3 AWT controls & layout managers
Understanding the use of AWT controls: labels, buttons,
checkbox, checkbox group, scroll bars, text field, text area
Understanding the use of layout managers: flowLayout,
borderLayout, gridLayout, cardLayout, gridbagLayout,
menubars, menus, dialog boxes, file dialog.
1.4 Introduction to swing
Swing features, MVC Architecture, Combo Boxes, progress bar,
tool tips, seperator, tables, trees, toggle button.
1 Introduction to Abstract Windowing Toolkit(AWT) & Swings
Specific Objective
-To design & develop Graphical user interface (GUI)
programs using AWT and swing component.
-To arrange the GUI components using different layout
managers.
1.1 Component, container, window, frame, panel.
26 1.2 Creating windowed programs & applets. U 2 Which Component are present in following image y Button, Label, JTable, JProgressbar JButton, JLabel, JTable, Progressbar JButton, JLabel, JTable, JProgressBar JButton, JLabel, Table, Progressbar JButton, JLabel, JTable, JProgressBar
1.3 AWT controls & layout managers
Understanding the use of AWT controls: labels, buttons,
checkbox, checkbox group, scroll bars, text field, text area
Understanding the use of layout managers: flowLayout,
borderLayout, gridLayout, cardLayout, gridbagLayout,
menubars, menus, dialog boxes, file dialog.
1.4 Introduction to swing
27 Swing features, MVC Architecture, Combo Boxes, progress bar, U 2 Which are the steps for Jtable Component with applet 1. Create JScrollPane object with appropriate constructor 2. 1.Create Jtable object 1.Create Jtable object 1.Create Jtable object 1.Create Jtable object
tool tips, seperator, tables, trees, toggle button. Create Jtable object 3. Add 2.Create JScrollPane object with appropriate constructor 2.Create JScrollPane object with appropriate constructor 2.Create JScrollPane object with appropriate constructor 2.Create JScrollPane object with appropriate constructor
Jtable object to contentpane 4. add 3. Add Jtable object to contentpane 3. Add Jtable object to scrollpane 3. Add Jtable object to scrollpane 3. Add Jtable object to scrollpane
JScrollPane to contentpane 4. add JScrollPane to contentpane 4. add JScrollPane to contentpane 4. add JScrollPane to contentpane
28 U 2 MVC Stand for Model Verify Controller Model View Controller Most Verify Controller Most Visual Component Model View Controller
29 2 Event Handling U 2 Which of these methods can be used to obtain the coordinates of a mouse? getPoint() getCoordinates() getMouseXY() getMouseCordinates() getPoint()
30 Specific Objective U 2 Which of these are integer constants of TextEvent class? TEXT_CHANGED TEXT_FORMAT_CHANGED TEXT_VALUE_CHANGED TEXT_SIZE_CHANGED TEXT_VALUE_CHANGED
-To write event driven programs using the delegation
31 event U 2 Which of these methods can be used to know the degree of adjustment made by user? getValue() getAdjustmentType() getAdjustmentValue() getAdjustmentAmount() getValue()
32 3 Networking & Security U 2 Select the proper constructor for receive Datagram Packets DatagramPacket(byte data[],int size) DatagramPacket(byte data[],int size,InetAddress ipAdr,int port) DatagramPacket(byte data[],int offset,InetAddress ipAdr,int port) DatagramPacket(byte data[],int offset,int size, InetAddress ipAdr,int DatagramPacket(byte data[],int size)
Specific Objective: port)
-To learn the Java’s built in support for network
programming.
33 - To write program to demonstrate connectivity through U 2 Which one is not a method of URLConnection class getDate() getContentType() getFile() getExpiration() getFile()
software SOCKETS, TCP, ISP, URL and the Java security
package.
3.1 Basics of Networking
34 Socket, IP, TCP, UDP, Proxy Server, Internet Addressing U 2 select the proper method to retrive the data from DatagramPacket getContent() getData() getFile() getInfo() getData()
3.2 The InetAddress Class
Factory methods
35 Instance methods U 2 What will be the output of following code? import mainsite /mainsite/ /mainsite /mainsite/ /mainsite/
3.3 TCP/IP Sockets java.net.*; class URLDemo { msbte.com -1 msbte.com -1 www.msbte.com www.msbte.com www.msbte.com
Socket, Server Socket, methods public static void main(String -1 -1 -1
3.4 URL args[]) throws MalformedURLException { URL hp = new
URL Connection, http, URL Connection methods, URL("http://www.msbte.com/mainsite/"); System.out.println(hp.getFile());
creating & System.out.println(hp.getHost());
using TCP/IP client & server System.out.println(hp.getPort());
3.5 Security with Java: Theoretical introduction to java.security } }
Package
Permission class
Policy class
36 4 Interacting with Database U 2 What is, in terms of JDBC, a DataSource A DataSource is the basic service for meanging a set of JDBC drivers A DataSource is the java representation of physical data source A DataSource is a registry point for JNDI-services A DataSource is a factory of connections to a physical data source A DataSource is a factory of connections to a physical data source
Specific Objective :
- To create database driven business applications using
the database API’S two tier and three tier models and the
Java.Sql package
4.1 JDBC, ODBC, & Other APIS
37 JDBC two tier & three tier models U 2 What happens if you call the method close() on a ResultSet object? the method close() does not exist for a ResultSet. Only Connections can the database and JDBC resources are released you will get a SQLException, because only Statement objects can close the ResultSet, together with the Statement which created it and the the database and JDBC resources are released
4.2 Connecting to Database be closed ResultSets Connection from which the Statement was retrieved, will be closed and
Driver Interface, Driver Manager class, Connection release all database andJDBC resources
Interface, Statement Interface, the java.sql.package
Establishing connection & retrieving information Resultset
interface.
38 U 2 What is the meaning of Resultset. TYPE_SCROLL_INSENSITIVE This means that the ResultSet is insensitive to scrolling This means that the Resultset is sensitive to scrolling, but insensitive to This means that the ResultSet is sensitive to scrolling, but insensitive to The meaning depends on the type of data source, and the type and This means that the ResultSet is sensitive to scrolling, but insensitive to
updates, i.e. not updateable changes made by others version of the driver you use with this data source changes made by others
39 5 Servlets & JSP U 2 The Life Cycle of a Servlet Managed by Servlet Context Servlet Container the supporting protocol All of the above Servlet Container
Specific Objectives :
- To write web based applications using servlets, JSP and
Java Beans.
- To write servlet for cookies and session tracking.
5.1 Servlet
40 Type of Servlet, Servlet life cycle. U 2 What is the limit of data to be passed from HTML when doGet() method is used 4k 8k 2k 1k 2k
5.2 Using servlets, response redirection.
5.3 Basic concepts of sessions, cookies & session tracking
5.4 Introduction to servlet chaining & filters, Introduction to
applet servlet communication.
5.5 JSP, expression, directives& declarations,
41 Life cycle of a JSP page TLD & JSTL, Java beans. U 2 Which of the following are the session tracking techniques URL rewriting, using session object, using response object, using hidden URL rewriting, using session object, using cookies, using hidden fields UrL rewriting, using servlet object, using response object, using cookies URL rewriting, using request object, using response object, using URL rewriting, using session object, using cookies, using hidden fields
fields session object
42 1 Introduction to Abstract Windowing Toolkit(AWT) & Swings A 2 Using the Java graphics method which statement would you write to create a circle of radius 20, centered at x=100 and y=100 g.drawOval(80,80,40,40) g.drawOval(80,80,20,20) g.drawOval(120,120,20,20) g.drawOval(100,100,20,20) g.drawOval(80,80,40,40)
43 Specific Objective A 2 Consider the following code fragment Color.blue Color.red Color.blue Color.blue Color.red Color.red Color.red Color.blue Color.red Color.red
-To design & develop Graphical user interface (GUI) Rectangle r1 = new Rectangle(); r1.setColor(Color.blue);
programs using AWT and swing component. Rectangle r2=r1;
-To arrange the GUI components using different layout r2.setColor(Color.red);
managers. After the above piece of code is executed, what are the colors of r1 and r2?
1.1 Component, container, window, frame, panel. (in this order)?
1.2 Creating windowed programs & applets.
1.3 AWT controls & layout managers
Understanding the use of AWT controls: labels, buttons,
44 checkbox, checkbox group, scroll bars, text field, text area A 2 which is correct code for following image y import java.awt.*; import java.awt.*; import java.awt.*; import java.awt.*; import java.awt.*;
Understanding the use of layout managers: flowLayout, import java.applet.*; import java.applet.*; import java.applet.*; import java.applet.*; import java.applet.*;
borderLayout, gridLayout, cardLayout, gridbagLayout,
menubars, menus, dialog boxes, file dialog. public class Demogr extends Applet public class Demogr extends Applet public class Demogr extends Applet public class Demogr extends Applet public class Demogr extends Applet
1.4 Introduction to swing { { { { {
Swing features, MVC Architecture, Combo Boxes, progress bar, public void init() public void init() public void init() public void init() public void init()
tool tips, seperator, tables, trees, toggle button. { setLayout(new GridLayout(3,0)); { setLayout(new GridLayout(0,3)); { setLayout(new GridLayout(1,3)); { setLayout(new BorderLayout()); { setLayout(new GridLayout(3,0));
add(new Button("NORTH")); add(new Button("NORTH")); add(new Button("NORTH")); add(new Button("NORTH"),BorderLayout.NORTH); add(new Button("NORTH"));
add(new Button("CENTER")); add(new Button("CENTER")); add(new Button("CENTER")); add(new Button("CENTER"),BorderLayout.CENTER); add(new Button("CENTER"));
add(new Button("SOUTH")); } add(new Button("SOUTH")); } add(new Button("SOUTH")); } add(new Button("SOUTH"),BorderLayout.SOUTH); } add(new Button("SOUTH")); }
} } } } }
/*<applet code="Demogr" width=200 height=200> /*<applet code="Demogr" width=200 height=200> /*<applet code="Demogr" width=200 height=200> /*<applet code="Demogr" width=200 height=200> /*<applet code="Demogr" width=200 height=200>
</applet>*/ </applet>*/ </applet>*/ </applet>*/ </applet>*/
45 A 2 what would be used as the top-level Swing component in a Java application Jobject Jwindow ContentPane Jframe Jframe
46 2 Event Handling A 2 which of the following components generate item event MenuItem CheckableMenuItem CheckableMenu CheckboxMenuItem CheckboxMenuItem
Specific Objective
-To write event driven programs using the delegation
event
model.
-To write programs using adapter classes & the inner
classes.
2.1 The delegation Event Model
47 Event sources, Event listeners, Event classes. The Action A 2 which of these methods are used to register a mouse motion listener? addMouseMotion() addMouseListener() addMouseMotionListener() addMotionListener() addMouseMotionListener()
48 Event A 2 which of these events will be generated if we close an applet's window? ActionEvent ComponentEvent AdjustmentEvent WindowEvent WindowEvent
class, The Component Event class, the Container Event class,
49 the A 2 Suppose that you want to have an object ch handle the TextEvent of TextArea object t. How should you add ch as the event handler for? t.addTextListener(ch) ch.addTextListener(t) addtextListener(ch.t) addtextListener(t,ch) addtextListener(t,ch)
Focus Event class, the Item Event class, the Key Event class,
50 the A 2 Which of these is superclass of all Adapter classes? Applet ComponentEvent Event InputEvent Applet
Mouse Event class, the Text Event class, the Window Event
51 3 Networking
class. & Security A 2 import java.net.*; 0 0 1 1 TRUE
Specific Objective: class networking1 {
-To learn the Java’s built in support for network public static void main(String[] args) throws UnknownHostException {
programming. InetAddress obj1 = InetAddress.getByName("www.google.com");
- To write program to demonstrate connectivity through InetAddress obj2 = InetAddress.getByName("www.google.com");
software SOCKETS, TCP, ISP, URL and the Java security boolean x = obj1.equals(obj2);
package. System.out.print(x);
3.1 Basics of Networking }
Socket, IP, TCP, UDP, Proxy Server, Internet Addressing }
3.2 The InetAddress Class
Factory methods
Instance methods
52 3.3 TCP/IP Sockets A 2 import java.net.*; google google.com www.google.com None of above google.com
Socket, Server Socket, methods class networking2 {
3.4 URL public static void main(String[] args) throws UnknownHostException {
URL Connection, http, URL Connection methods, InetAddress obj1 = InetAddress.getByName("google.com");
creating & System.out.print(obj1.getHostName());
using TCP/IP client & server }
3.5 Security with Java: Theoretical introduction to java.security }
Package
Permission class
Policy class
53 4 Interacting with Database A 2 How can you execute a stored procedure in the database? Call method execute() on a CallableStatement object Call method executeProcedure() on a Statement object Call method execute() on a StoredProcedure object Call method run() on a ProcedureCommand object Call method execute() on a CallableStatement object
54 Specific Objective : A 2 What is correct about DDL statements (create, grant,…)? DDL statements are treated as normal SQL statements, and are To execute DDL statements, you have to install additional support files DDL statements cannot be executed by making use of JDBC,you should Support for DDl satements will be a feature of a future release of JDBC DDL statements are treated as normal SQL statements, and are
- To create database driven business applications using executed by calling the execute() method on a Statement(or a sub use the native databse tools for this. executed by calling the execute() method on a Statement(or a sub
the database API’S two tier and three tier models and the interface thereof) object interface thereof) object
Java.Sql package
55 4.1 JDBC, ODBC, & Other APIS A 2 What happens if you call deleteRow() on a ResultSet object? The row you are positioned on is deleted from the ResultSet,but not The row you are positioned on isdeleted form the ResultSet and from The result depends on whetherthe property You will get a compile error:the method does not exist because you can The row you are positioned on isdeleted form the ResultSet and from
JDBC two tier & three tier models from the database. the database. synchronizeWithDataSource is set to true or false. not delete rows from a ResultSet. the database.
4.2 Connecting to Database
56 Driver Interface, Driver Manager class, Connection A 2 How do you use a savepoint? A savepoint is realised by calling setAutoCommit(true) on the A savepoint is activated by the method set SavePoint("mysavepoint") A savepoint is used to mark intermediate points inside a transaction,in A savepoint triggers an automatic synchronisation with the database. A savepoint is used to mark intermediate points inside a transaction,in
Interface, Statement Interface, the java.sql.package connectiion. on the transaction. order to get a more fine-grained control.Transactions can br rolled order to get a more fine-grained control.Transactions can br rolled
Establishing connection & retrieving information Resultset back to a previous savepoint without affecting preceding work. back to a previous savepoint without affecting preceding work.
interface.
57 A 2 How can you execute DML statements (i.e. insert,delete,update)in the database? By making use of the InsertStatement,DeleteStatement or By invoking the execute(...) or executeUpdate(...) method of a normal By invoking the executeInsert(...),executeUpdate(...) methods of the By making use of the execute(...) statement of the By invoking the execute(...) or executeUpdate(...) method of a normal
UpdateStatement classes Statemant object or a sub-interface object thereof DataModificationStatement object DataModificationStatement object Statemant object or a sub-interface object thereof
58 5 Servlets & JSP A 2 Dynamic interception of requests and responses to transform the information is done by servlet container servlet config servlet context servlet filter servlet filter
59 Specific Objectives : A 2 What's the difference between servlets and applets? 1.Servlets 1,2,3 are correct 1,2 are correct 1,3 are correct 1,2,3,4 are correct 1,2 are correct
- To write web based applications using servlets, JSP and executes on Servers, where as Applets executes on Browser 2. Servlets have no
Java Beans. GUI, where asan Applet has GUI. 3.Servlets creates static web pages,
- To write servlet for cookies and session tracking. where as Applets creates dynamic web pages.
5.1 Servlet 4. Servlets can handle only a single request, where as Applet can handle multiple requests
Type of Servlet, Servlet life cycle.
5.2 Using servlets, response redirection.
60 5.3 Basic concepts of sessions, cookies & session tracking A 2 Which method is used to specify before any lines that uses the PrintWriter? setPageType() setContextType() setContentType() setResponseType() setContentType()
61 5.4 Introduction to servlet chaining & filters, Introduction to A 2 The major difference between servlet and CGI is Servlets are thread based and CGI is process based Servlets executes slower compared to CGI Servlet has no platform specific API, where as CGI has All of the above Servlets are thread based and CGI is process based
applet servlet communication.
62 5.5 JSP, expression, directives& declarations, A 2 In which of the following cases the request.getAttribute() will be helpful? If a servlet or jsp is invoked using sendRedirect method. If a servlet or jsp is invoked using forword method If a servlet or jsp isinvoked using a hyperlink in the page. If a servlet or jsp invoked if when form submits. If a servlet or jsp is invoked using forword method