PRP Wipro
PRP Wipro
PRP Wipro
prints: A.m1
Compile-time error at line 1
Compile-time error at line 2
Run-time error at line 1
2.
class Super{
int i=0;
Super(String s){
i=10;
}
}
class Sub extends Super {
Sub(String s){
i=20;
}
public static void main(String args[]) {
Sub b=new Sub("hello");
System.out.println(b.i);
}
}
What is the output ?
Runtime Error
10
20
3.
Which of the following is not a mandatory
attribute for <APPLET> tag?
Name is not mandatory
width
height
name
4.
________ components can be used for guiding
the user with description for input components
in GUI.
JLabel
JPanel
JButton
Any of the above
5.
Prints: A.m1
Compile-time error at line1.
Compile-time error at line 2.
Run-time error at line 1.
6.
Prints: A.m1
Compile-time error at line1.
Compile-time error at line 2.
Run-time error at line 1.
7.
0
102
1
02
8.
A software blueprint for objects is called a/an
Interface
Class
Prototype
method
9.
What is the output when the following code is
compiled and/or executed?
public class Test {
private void method(){
System.out.println(“method”);
throw new RuntimeException();
}
public static void main(String[] args){
Test t = new Test();
t.method();
}
}
10.
BorderLayout
BoxLayout
FlowLayout
GridLayout
11.
}
// Class D is declared in a file named D.java.
package pack1.pack2;
import pack1.A;
public class D {
public static void main(String[] args) {
A a = new A(); // line 1
a.m1(); // line 2
}}
Prints: A.m1
Compile-time error at line1.
Compile-time error at line 2.
Run-time error at line 1.
12.
Which of the following is not a primitive data
type
int
boolean
float
long
String
13.
14.
Class A{
A(){}
}
Class B{}
Class C
{
Public static void main(String arg[])
{
}
}
15.
Class A{
A(){}
}
Class B
{
B(int x){}
}
Class C
{
Public static void main(String arg[])
{
A ab=new A();
B cd=new B();
}
}
16.
Class A{
A(){}
}
Class B
{
B(){}
B(int a){super(200);}
}
Class C
{
Public static void main(String arg[])
{
A ab=new A();
B cd=new B(23);
}
}
17.
int x[]={1,2,3};
try
{
For(int i=0;i<=x.length();i++)
{
S.op(x[i]);
}
S.o.p(“Done”);
}
Catch(ArrayIndexOutofBoundException ae)
{
S.o.p(“Catch”);
}
Finally
{
S.o.p(“Final”);
}
S.o.p(“XXX”);
}
}
e. Compile time err
f. Run time err
g. Prints:123catchfinalXXX
h.Prints123catchdonefinalxxx
19.
20.
1. public
2. private
3. abstract
21.
Which of the following can not be declared inside
<Head>
1. table
2. script
3. style
4. title
22.
In <img> tag src is used for ---------
1. type of image
2. path of file
3. type of file
23.
Wrapper class for char is -------
1. CHAR
2. character
3. Char
4. Character
24.
In ordered list default attribute for type is\
1. 1
2. A
3. I
4. i
25.
26.
Which of the following attribute for giving line break
in html
1. <BR>
2. line break
3. line_break
27.
Which of the following attribute is invalid in <Form>
1. name
2. action
3. method
4. Get
28.
Which of the following can be used to create filled
form
1. <form>
don’t remember other options……
29.
What is the coorect way to declare script language
1. <script language=”XXX.js”>
2. language=java script
3. <script_language=”java script”>
4. <script language=”java script”>
30.
Which of the following can be used to itterate
through all the objects
1. do … while
2. while
3. for in
4. for
31.
which of following is correct way to declare arrays in
java script
1. a={1,2,3}
2. a=new {1,2,3}
3. a=new Array(10);
32.
“Network is a computer” is themeline of _________
1. microsoft
2. Cisco
3. Sun microsystem
4. IBM
5. Wipro Technologies
33.
setTimeOut() method in java script is used to
34.
<Title> tag is declared in side which tag
1. Before <Body>
2. After <Body>
3. Between <Head>
4. Anywhere in html
35.
Which is not a font attribute
1. size
2. color
3. face
4. list
36.
1. get
2. post
3. set
4. let
38.
How we call function abc() in java script.
1. call abc()
2. calling abc
3. abc()
4. none
39.
which method is used to get the values of
components in html/applet
1. getParam()
2. getParameter()
3. getValue()
4. getParameterValues()
40.
All classes extends Object true or false
1. true
2. false
42.
. What is the maximum size of an cookie
• 4kb
• 20kb
• 300kb
• 30kb
44.
How to create new window in java script
1. a=new window();
2. window.open(“ABC”);
3. mywin=open(“ABC”,”disp”)
45.
What we use for session tracking if there is no
cookie.
1. url rewriting
2. session object
3. not possible without cookies
46.
In jdbc type 4 driver is written in
1. java
2. native
3. c
4. c++
47.
What is the correct format of JDBC URL
1. jdbc:<subprotocol>:<subname>
2. jdbc:<subprotocol>:<subname>:driver
3. jdbc:<subprotocol>
48
49.
When no data is found which of the following will
return false
1. % rowcount
2. %found
3. %notfound
50.
What is used to set attributes in callable statement
1. *
2. $
3. #
4. ?
51.
JSP means
52.
Diff between include directive and <jsp:include>
53.
One question on getServletConfig.getInitParameter()
54.
What is compulsary in in <jsp:usebean>
1. name
2. calss
3. type
4. id
55.
Which of the following is mutating
1. setValue()
2. setProperty()
3. getProperty()
4. getValue()
56.
Jsp pages are compiled into
1. valid
2. invalid
3. compiled
66.
Number of methods available in MouseListener
Interface
a)1
b) 5
c) 6
d) 4
those r void mousePressed(MouseEvent me)
void mouseReleased(MouseEvent me)
void mouseClicked(MouseEvent me)
void mouseEntered(MouseEvent me)
void mouseExited(MouseEvent me)
67.
1. select
2. from
3. in
70) Class test
{
Public static void main(string[] args)
{
int one=1;
int two=2;
system.out.println(“Parvathi”+one+two);
}
}
1)Parvathi+one+two
2)Parvathi12
3)Parvathi 1 2
< APPLET
[CODEBASE = codebaseURL]
CODE = appletFile
[ALT = alternateText]
[NAME = appletInstanceName]
- 437 -
WIDTH = pixels HEIGHT = pixels
[ALIGN = alignment]
[VSPACE = pixels] [HSPACE = pixels]
>
[< PARAM NAME = AttributeName VALUE
= AttributeValue>]
[< PARAM NAME = AttributeName2
VALUE = AttributeValue>]
Exception
RuntimeExcetion
ArthmeticException
Ans : Exception
Interface
Abstract
class
Ans.: abstract
1
4
1&2
1,2 & 3
Ans : D
by subclasses.
10) Which method is used to call the constructors of
the superclass from the subclass?
Super()
This()
Ans : super()
17) If you run the code below, what gets printed out?
String s=new String("Bicycle");
int iBegin=1;
char iEnd=3;
System.out.println(s.substring(iBegin,iEnd));
a)Bic
b) ic
c) icy
d) error: no method matching substring(int,char)
Ans : b.
-
--------------------------- that’s all I
remember……………………………………………..