0% found this document useful (0 votes)
18 views9 pages

Msbte Ajp ct2

Uploaded by

Rutuja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views9 pages

Msbte Ajp ct2

Uploaded by

Rutuja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

10/12/2016 Online e-Exam Portal of MSBTE

Maharashtra State Board of Technical Education


(A utonomous) (ISO 9001:2008) (ISO/IEC 27001:2005)

Welcome 1304210013 [122.15.128.81]


My Home Log Out

Enter Test Password and click on End Test Button End Test Time Ramaining
00 : 09 : 25
Total Answered Questions 62 Total Un-Answered Questions 0

Overview of Examination

Q
Question Status Edit
No

C heckable menu items are created using object of …………………….class.


1 Answered C hange/Edit1

Which are passive controls that do not support any interaction with the user?
2 Answered C hange/Edit2

A component that combines a button or editable field and a drop-down list.


3 Answered C hange/Edit3

Which of the following constructor is used for creating frame window with the title
4 Answered C hange/Edit4

Which of the following are passed as an argument to the paint( ) method?


5 Answered C hange/Edit5

Which component in swing represents data in rows and columns?


6 Answered C hange/Edit6

MutableTreeNode is extends__________________interface
7 Answered C hange/Edit7

__________ method is used to add the menubar on frame window.


8 Answered C hange/Edit8

What interface is extended by AWT event listeners?


9 Answered C hange/Edit9

Which event is generated when component gain or losses keyboard focus.


10 Answered C hange/Edit10

___________method that is invoked when the mouse wheel is moved.


11 Answered C hange/Edit11

How many types of component events are in Java?


12 Answered C hange/Edit12

________ classes in security implement message digest & Digital signatures and can
13 authenticate java classes & other objects Answered C hange/Edit13

What is Second part of URL address


14 Answered C hange/Edit14

byte[] getData() method is defined by _____ class.


15 Answered C hange/Edit15

Which of these methods is used to know when was the URL last modified?
16 Answered C hange/Edit16

Return type of executeQuery() method is ___________


17 Answered C hange/Edit17

Which among the below is not an interface of java.sql Package


18 Answered C hange/Edit18

Which Interface is used to execute dynamic SQL statements?


19 Answered C hange/Edit19

http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 1/9
10/12/2016 Online e-Exam Portal of MSBTE

___________________ interface represents the comprehensive information about the database


20 package. Answered C hange/Edit20

Which request method is used to send the query string(name/value pairs ) in the URL
21 Answered C hange/Edit21

Who is responsible for creating request & response object for a web server?
22 Answered C hange/Edit22

Which of the following is an implicit object?


23 Answered C hange/Edit23

Identify secure method to send data from client to server.


24 Answered C hange/Edit24

You can create a JTable using __________


25 Answered C hange/Edit25

What is the code for following output

26 Answered C hange/Edit26

Identify layout used in the output given below.

27 Answered C hange/Edit27

Identify components which are used to get the following output

http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 2/9
10/12/2016 Online e-Exam Portal of MSBTE

C hange/Edit28
28 Answered

Which of the following is not one of the seven methods for handling window events?
29 Answered C hange/Edit29

Select the missing statement in the given code


import java.awt.*;
import java.applet.*;
import java.awt.event.*;
/*<applet code=textevdemo width=400 height=400>
</applet>*/
30 public class textevdemo extends Applet implements TextListener Answered C hange/Edit30
{
TextField f=new TextField("Hello");
public void init()
{
f.addTextListener(this);
}
public void textValueC hanged(TextEvent e)
{
Fill in blank
showStatus("you are changeing text from textfield");
}
}
import java.awt.*;
import java.awt.event.*;
31 public class MC lick extends Frame implements -------------------------- Answered C hange/Edit31
{
public static void main(String argv[]){
MC lick s = new MC lick();
}
MC lick(){
this.addMouseListener(this);
}
Which of the following statement is used by server to accept connection request from client?
public void mouseC licked(MouseEvent e){
32 System.out.println(e.getWhen()); Answered C hange/Edit32
}
}
If you use either Telnet or FTP, which is the highest layer you are using to transmit data?
33 Answered C hange/Edit33

Select the proper constructor of the Socket class


34 Answered C hange/Edit34

Find the correct way to throw the exception.

35 import java.net.*; Answered C hange/Edit35


public class URLDemo {
public static void main(String argts[])
{
URL netAddress= new URL("http://www.msbte.com//index.html");
System.out.print("port:"+InetAddress.getPort());
}
PreparedStatement interface extends____________________ interface
}
36 Answered C hange/Edit36

Which of the following query is used for SELEC T query?


37 Answered C hange/Edit37

The ResultSet is used to get information about a………………………..


38 Answered C hange/Edit38

What is the difference between cookies and Httpsession?


39 Answered C hange/Edit39

Which method is used to get HttpSession object and it belongs to which object?
40 Answered C hange/Edit40

The following methods belongs to the life cycle methods of the servlet.
http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 3/9
10/12/2016 Online e-Exam Portal of MSBTE
The following methods belongs to the life cycle methods of the servlet.
41 Answered C hange/Edit41

Debug the given program so as to get the following output


import java.awt.*; import javax.swing.*; /*<applet code="test" width=200 height=200>
</applet>*/
public class test extends JApplet { public void init(){ C ontainer
c=getC ontentPane();JTabbedPane jp=new JTabbedPane(); JButton b1=new
JButton("C OMP.TEC H"); p1.add(b1); JButton b2=new JButton("INFO.TEC H"); p1.add(b2);
JButton b3=new JButton("ELEC .ENGG"); p1.add(b3); JButton b4=new JButton("FIRST");
p2.add(b4); JButton b5=new JButton("SEC OND"); p2.add(b5); JButton b6=new
JButton("THIRD"); p2.add(b6); jp.addTab("Branch",p1); jp.addTab("Year",p2); c.add(jp); } }

42 Answered C hange/Edit42

Which of the following statement is missing from the program to be correct?


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Jprogress extends JPanel
{
JProgressBar pb;
static final int min=50;
static final int max=100;
public Jprogress()
{
pb=new JProgressBar();
pb.setMinimum(min);
pb.setMaximum(max);
add(pb);
43 Answered C hange/Edit43
}
public void update(int value)
{
pb.setValue(value);
}
public static void main(String a[])
{
final Jprogress p1=new Jprogress();
JFrame f=new JFrame("Demo");
f.setDefaultC loseOperation(JFrame.EXIT_ON_C LOSE);
f.setSize(300,300);

f.setVisible(true);
for (int i=min;i<=max;i++)
{
final int percent=i;
try
{
p1.update(percent);
java.lang.Thread.sleep(100);
}
catch(Exception e){ }
}
______________ displays a message that alerts the user and waits for the user to click the OK
}
button to close the dialog.
44 } Answered C hange/Edit44

Button control implements following Listener interface?


45 Answered C hange/Edit45

46 Answered C hange/Edit46

http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 4/9
10/12/2016 Online e-Exam Portal of MSBTE

What type of eventlisteners can be added to the following code


import java.awt. C ontainer;
import java.awt. Font;
import java.awt. Gridlayout;
import java.awt. Jbutton;
import java.awt. JFrame;
public calss GridSize test extends Jframe { public static void main (string[] args )
{ GridSize Test gst = new Grid Size Test ();
gst. set Default C lose Operation (JFrame. EXIT_ON_C LOSE); gst. pack ();
gst.set Visible (true); } public GridSize Test ()
C ontainer pane = getC ontent Pane ();
pane.set layout (new Gridlayout (2,2));
JButton button = new Jbutton ("First " ) pane. add (button ) ;
button = new JButton ("Second with a very long name " ); pane. add ( button); button = new
JButton ("Hi");
button. set Font (new Font ("courier", Font. PLANIN, 36));
pane . add (button ); button = new JButton ("there"); pane. add ( button ?); } }

import java.applet.Applet;
For the following code select the method that can be used to handle event
import java.awt.*;
import java.awt.event.*;
/*<applet code="scr" width=300 height=300></applet>*/
public class scr extends Applet implements AdjustmentListener
{
Scrollbar r,g,b;
public void init()
{
r=new Scrollbar(Scrollbar.HORIZONTAL,0,50,0,255);
g=new Scrollbar(Scrollbar.HORIZONTAL,0,50,0,255);
47 b=new Scrollbar(Scrollbar.HORIZONTAL,0,50,0,255); Answered C hange/Edit47
add(r);
add(g);
add(b);
r.addAdjustmentListener(this);
g.addAdjustmentListener(this);
b.addAdjustmentListener(this);
}
public void _______________________________________
{
C olor c=new C olor(r.getValue(),g.getValue(),b.getValue());
setBackground(c);
}}

method that is invoked when the state of an item changes.


48 Answered C hange/Edit48

Identify the missing statements in the following code.

49 Answered C hange/Edit49

http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 5/9
10/12/2016 Online e-Exam Portal of MSBTE

Select Proper C ommand to run following program


import java.awt.*;
import java.awt.event.*;
class FrameDemo extends Frame
{
FrameDemo()
{
addWindowListener(new M());
}
public static void main(String args[])
{
FrameDemo f=new FrameDemo();
50 f.setSize(100,200); Answered C hange/Edit50
f.setTitle("Frame window");
f.setVisible(true);
}
public void paint(Graphics g)
{
g.drawString("this is a frame",100,200);
}

class M extends WindowAdapter


{
public void windowC losing(WindowEvent we)
{
System.exit(0);
C hoose the correct output
}
import java.net.*;
}
class networking
}
{
public static void main(String args[])throws UnknownHostException
{
51 InetAddress obj1 =InetAddress.getByName("msbte.com"); Answered C hange/Edit51
InetAddress obj2 =InetAddress.getByName("msbte.com");
boolean x = obj1.equals(obj2);
System.out.print(x);
}
}

what is out put of following code? import java.io.*;


import java.net.*;
public class URLC onnectionExample {
public static void main(String[] args){
try{
URL url=new URL("http://www.msbte.com/java-tutorial");
52 URLC onnection urlcon=url.openC onnection(); Answered C hange/Edit52
InputStream stream=urlcon.getInputStream();
int i;
while((i=stream.read())!=-1){
System.out.print((char)i);
}
}catch(Exception e){System.out.println(e);}
}
}
what is the output of following code

import java.sql.*;

class cont {
public static void main(String args[]){
53 try { Answered C hange/Edit53
C lass.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);
System.out.println(“Drivers are properly loaded”);
String url=”jdbc:odbc:abc”;
C onnection con=DriverManager.getC onnection(url);
System.out.println(“C onnection to database created”);
con.close();
}
catch(SQLExcption e)
{
System.out.println(“SQL Error ”);
{
catch(Exception e)
{
System.out.println(“error”);
}
}
}

http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 6/9
10/12/2016 Online e-Exam Portal of MSBTE

Select correct statement for connect mysql database?

54 a) TYPE_FORWARD_ONLY: creates a nonscrollable result set, that is, one in which the cursor Answered C hange/Edit54
moves only forward
b) TYPE_SC ROLL_INSENSITIVE : a scrollable result set does not reflects changes that are made
to it while it is open
c) TYPE_SC ROLL_SENSITIVE: a scrollable result set reflects changes that are made to it while
it is open
d) none of these.

The following example to connect Java Application with access?


import java.sql.*;
class Test{
public static void main(String ar[]){
try{
String url="jdbc:odbc:mydsn";
55 C lass.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Answered C hange/Edit55
C onnection c=DriverManager.getC onnection(url);
Statement st=c.createStatement();
ResultSet rs=st.executeQuery("select * from login");

while(rs.next()){
System.out.println(rs.getString(1));
}
C onnection con=DriverManager.getC onnection(url);
}catch(Exception ee){System.out.println(ee);}
56 this command will create the following Answered C hange/Edit56
}}

57 Answered C hange/Edit57

C onsider the following program and select the code that should get added to get the following
output import java.sql.*;
class stud5
{
public static void main(String ar[])throws Exception
{
C lass.forName("sun.jdbc.odbc.JdbcOdbcDriver");
C onnection con=DriverManager.getC onnection("jdbc:odbc:studdsn");
Statement s1=con.createStatement();
ResultSet res;
System.out.println("Before insertion");
res=s1.executeQuery("select * from student");
while(res.next())
{
System.out.println("Namet"+res.getString(1)+" Roll_NOt"+res.getInt(2)+"
pert"+res.getInt(3));
}
PreparedStatement st=con.prepareStatement("insert into student values(?,?,?) ");
st.setString(1,"Sayali");
st.setInt(2,45);
st.setInt(3,70);
st.executeUpdate();
st.setString(1,"Katta");
st.setInt(2,43);
st.setInt(3,70);
st.executeUpdate();
System.out.println("After insertion");
res=s1.executeQuery("select * from student");
}
}

http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 7/9
10/12/2016 Online e-Exam Portal of MSBTE

C hoose missing statements in following code from given options.

public class session1 extends HttpServlet


{
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throwsServletException, IOException
{
HttpSession hs = request.getSession(true);

PrintWriter pw = response.getWriter();
pw.print("<B>");
Date date = (Date)hs.getAttribute("date");
if(date != null) {
pw.print("Last access: " + date + "<br>");
58 } Answered C hange/Edit58
date = new Date();
hs.setAttribute("date", date);
pw.println("C urrent date: " + date);
}
}

In following Java program fill statement showing ***.Select any one option fro given options

import javax.servlet.*;
import javax.servlet.http.*;
public class AddC ookieServlet extends HttpServlet
{
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throwsServletException, IOException
{
String data = request.getParameter("data");
C ookie cookie = new C ookie("My C ookie",data);
59 response.*********; Answered C hange/Edit59
response.setC ontentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<B>MyC ookie has been set to");
pw.println(data);
pw.close();
}
}

To store the cookie object which method is used and of which class/interface?
60 Answered C hange/Edit60

What is the missing statement in the following program to get the proper output
import java.io.*;
import java.util.*;
public class HelloWorld extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setC ontentType("text/html");
PrintWriter out = response.getWriter();
HttpSession hp=request.getSession(true);
Date create=new Date(hp.getC reationTime());
Date access=new Date(hp.getLastAccessedTime());
out.println("<h1><br>Session is created at "+create);
out.println("<h1><br>Last access time is "+access);
out.println("<h1><br>Session id is "+hp.getId());
}
}

61 Answered C hange/Edit61

http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 8/9
10/12/2016 Online e-Exam Portal of MSBTE

Assume that you need to write a JSP page that adds numbers from one to ten and then print
the output.

62 <% int sum=0; Answered C hange/Edit62


for(int i=1;i<=10;i++) { %>
<%sum=sum+i; %>
<% } %>
YYY
Which statement must be added at the location of YYY to print the sum of ten numbers.

http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 9/9

You might also like