j2ee prp important mcq question and answer.

 j2ee prp important mcq question and answer.



Hey guys, I know you are worried about your prp assessment. Before going ahead i would say be relax and study hard. It is not tough like that some people says. Here I am going to provide you some  j2ee prp important mcq question and answer. questions may be which going to help you in your prp assessment test.  Answers of these questions are in green color. Remember I am not saying that thse questions will be ask in your prp assessment test but thse question will give you an idea which type of questions they ask. 

1)  Which is the serializable interface

a)      object

b)      method

c)      classes

d)     state

2.) Abstract class can’t be final in java.

a) True

b) False

3.) It is _________________________ to have an abstract method.

a) Not mandatory for an static class

b) Not mandatory for a derived class

c) Not mandatory for an abstract class

d) Not mandatory for parent class

4.) How many abstract classes can a single program contain?

a) At most 1

b) As many as required

c) At least 1

d) At most 127


5)  What will be the output for the program?

 Declare

Var number;

Begin

Var=null;

For var in 10..100

Loop

Dbms_output.put_line(var);

End loop;

Dbms_output.put_line(var);

End;

6.)      Which is a wrapper class?

a)      float

b)      char

c)      int

d)     bool

Explanation: Wrapper classes provide a way to use primitive data types (int,boolean, etc..) as objects.

The table below shows the primitive type and the equivalent wrapper class:

Primitive Data TypeWrapper Class
byteByte
shortShort
intInteger
longLong
floatFloat
doubleDouble
booleanBoolean
charCharacter


7.)      Attribute in an applet tag is _________________

a)      codeclass

b)      codename

c)      codebase

d)     none


7)    Attribute in an applet tag is _________________

a)      length

b)      width

c)      class

d)     breadth

8)      Class loader is in  Java Runtime Environment (JRE).

11.)  JSP expression is represented by ___________

a) <%        %>

b) <%0        %>

c) <% !       %>

d) <% =      %>

13) JSP directive is represented by ___________

a) <% @       %>

b) <%0        %>

c) <% !       %>

d) <% =      %>

16)  Client bean call session bean and connect directly to the database

true

false

17.)  What will specify IS A relationship?

a)      IS A

b)      Extends

c)      Volatile

d)     Instance of

18.)  Abstract class can be ___________

a)     final

b)      subclass

c)      instantiated

d)      none


19)  log() method is available in which interface?

ans: Logger Interface

20.) What will be the output?

a)      compile time error

b)      run time error

c)      both compile and run time error

d)     none of the above


 class A

{

A()

{

}

}

Class B extends A

{

B()

{

}

}

Class C

{

Public static void main(string args[])

{

}

21.)  If a table has 2 columns with NOT NULL and UNIQUE constraints on it ..what will be the candidate/ primary key?

a)      both are called candidate key

b)      one can be a primary key

c)      one can be a candidate key

d)     none of the above

25)  Super key can be of __________

a)      primary key + a non key

b)      unique key + a non key

c)      candidate key + a non key

d)     none of the above


26)  Implicit cursors will be used in __________

a)      select query

b)      update query

c)      delete query

d)     all the above

27)  comparison operator in SQL

a)      =

b)      *

c)      $

d)     #

28.)  How to give the title to a table?

a)      <title>

b)      <head>

c)      <caption>

d)     <body>

29.)  How to give the italics style in html

a)      <ii>....</ii>

b)      <it>...</it>

c)      <i>....</i>

d)     <italics>....</italics>

30)   What is the immediate superclass of  Applet class?

a)      window

b)      Panel

c)      container

d)     object

31)  ____________ class is a wrapper class for the character data type.

a)      char

b)      character

c)      CHAR

d)     CHARACTER

32)  Which operator is used as a termination operator in SQL?

a)      ;

b)      @

c)      #

d)     !

33.)  Return type of getparameter(string) is ____________

a)      String

b)      object

c)      int

d)     character

34.)  Servlet is ___________

a)      j2ee application

b)      CGI

c)      Java API

d)     Netscape

35.)    ER diagram is _______________

a)      high level model

b)      low level model

c)      representational model

d)     hierarchical model

36.)  What will be the column heading for the given query?

SELECT sal*10 supply FROM emp;

a)      supply

b)      Supply

c)      SUPPLY

d)     sal*10


37.)  Class sample

{

Public Static Void Main(string a[])

{

int one=1,two=2;

System.Out.Println(one+”Hello”+two);

}

}


a)      1+Hello+2

b)      One+Hello+two

c)      Hello

d)     None of the above


38)   The syntax for the frame _______________

a)      frame is declared within the body

b)      frameset is declared within body

c)      frame is declared within frameset

d)     frameset is declared within frame



39)  _____________ is the superclass of all classes that are in input streams.

a)      output stream

b)      input stream

c)      buffered o/p stream

d)     object output stream



40.)  What will be the output for the given query?


SELECT ‘wipro’ FROM dual where NULL is NULL;

a)      Wipro

b)      Error

c)      No output

d)     Null values


41.)   ______________ is a single occurrence of entity type

a)      row

b)      column

c)      instance

d)     none of the above


42.)  SELECT empno|| ‘ ‘||eage||’ ‘||edate||’ ‘||Hiredate from emp;

a)      Datatype mismatch

b)      It will display all the columns it mentioned

c)      Error

d)     No output

43.)  Write a subquery to select a department where there are no employees in it.

44.)  Transaction is ____________

a)      group of DML statements that can’t be rolled back

b)      group of DML statements on a single table

c)      group of DML statements on different tables of same schema

d)     group of DML statements that are executed (all) or none


45.)  Vector v=new vector(10);

What will be the next line?

a)      v.addElement(10);

b)      v.add(10);

c)      v.addElement(new Integer(10))

d)     v.addElement(Integer(10))


46.)  Output and input streams are __________ classes

a)      static

b)      final

c)      abstract

d)     concrete



47.)  %rowcount gives __________

a)      no of rows in the table

b)      no of rows processed so far

c)      none of the above

d)     both a and b

48.)  In a table tag, which option is used to get the space between table border and cells?

a)      cellspacing

b)      cellpadding

c)      rowspan

d)     colspan


49.)  abstract class A

{

abstract void m1();

abstract void m2();

}

abstract class  B extends A

{

void m1()

{

};

}

Class C extends A

{

  void m2()

{

}

}


Class D

{

Public Static Void Main()

{

C c1=new C();

C.m2();

}


a)      compiler time error

b)      runtime time error

c)      logical error

d)     none of the above


50.)  Interface sample

{

  abstract void m2(){ };

}

Class A implements Sample

{

   Public Void m1()          //line1

}

Class B implements Sample{ void m1(int j){ }}  //line 2

Class C implements Sample{ void m2(int i){ }}  //line 3


Which line(s) will throw error?

a)      Line 1

b)      Line 2

c)      Line 2 and Line 3

d)     Line 3



51.)  What is the return type of execute()

a)      result

b)      resultset

c)      int

d)     Boolean

52.)  Implicit savepoint is created

a)      when a transaction starts

b)      when user starts a session

c)      when the user logs off the session

d)     none of the above

53)  __________ is a Type II driver

54)  ___________ is a Type I driver

55)  When the index is removed, _________________

a)      only the index is dropped

b)      both the table & index gets dropped

c)      table becomes invalid

d)     none of the above



56)   When the sequence is removed, _________________

a)      only the index is dropped

b)      both the table & index gets dropped

c)      table becomes invalid

d)     none of the above


57)  Write the sequences of stages while creating the cusors

58)  Classloader is a part of ______________

a)      JNI

b)      JVM

c)      JSM

d)     None


59)  The argument for the service method

a)      service(HttpRequest,HttpResponse)

b)      service(HttpResponse,HttpRequest)

c)      service(HttpServletRequest, HttpServletResponse)

d)     service(ServletResponse,ServletRequest)


60)   The package of Generic Servlet is ____________

a)      Java.Servlet

b)      Javax.Servlet

c)      Javax.Servlet.generic

d)     Javax.Servlet.http


61)  If you are changing the code in the procedure,the previous procedure code and the changed source code will be in ______________

a)      USER_DEPENDENCIES

b)      USER_PROCEDURE

c)      USER_SOURCE

d)     USER_SOURCECODE


62.)  What is the relationship in the network model?

a)      1:1

b)      1:M

c)      M:1

d)     M:M

63)  Array in java is ____________

a)      string of characters

b)      string of numbers

c)      reference type

d)     primitive datatype


64)  What is the superclass of Exception?


65)  Class super

{

int i=10;

void display()

{

System.Out.Println(i);

}

}


Class sub extends super

{

int j=10;

void getmethod()

{

i=20;

System.Out.Println(i);

}

}


Public Static Void Main(string args[])

{

Super obj=new sub();

Obj.getmethod();

}



66)  Interface A

{

void display();

}


Class B implements A

{

   Public void display(){} //line 1

Private void display(){}//line 2

Protected void display(){}// line 3

}


Which is invalid?

a)      line 1

b)      line 2

c)      line 3

d)     All the above


67)  What is true about ORACLE?

a)      It will detect the deadlock & handles it rather than preventing

b)      It will not allow other user to read the data when one is already reading


68)  Interface A()

{

void ABC()

}

Class B implements A

{

void ABC()

{

int i=10;

}

void display()

{

System.Out.Println(i);

}

}

Public Static Void Main(string args[])

{

A obj=new B();

Obj.ABC();

Obj.display();

}


69)  Which is not primitive data type?

a)      int

b)      long

c)      short

d)     String


70)  In “emp” table, there are null values for some of the columns in all the  rows. Totally there are 14 rows in the table. What will be the output if the given query is executed?

SELECT 5000 FROM emp;

a)      Null is printed only once

b)      NULL will be printed 14 times null

c)      5000 will be printed 14 times

d)     rror

71)   which provides transaction?

a)      RMI

b)      JNDI


72)  What is true about EntityBean(EB) and SessionBean(SB)?

a)      EB is the superclass of SB

b)      Sb is the superclass of EB

c)      EB is accessible to all the users of SB which is session specific

d)     None


73)  Predict the output for the given query:

SELECT * FROM emp where ename between ‘A’ and ‘C’;


74)   Emp Table has 3 columns like Empno,Ename,Passport….All the columns are unique. Which key can be considered as a primary key?

a)      All the three

b)      None

c)      empno

d)     Passport

75) Dependent entity should have __________

a)      same data type as the parent

b)      differs in their datatype from the parent one

c)      we can’t create a dependent enitity

d)     none of the above


76) The Main difference between the anonymous block and the procedure

e)      We can’t define %rowtype in anonymous block but it is possible in procedure

f)       Anonymous block is not an object but procedure is an object


77)    Which of the following is/are true?

i)        subquery will return more than one value

ii)      Subquery should be declared on the right hand side of the operator


a)      i only

b)      ii only

c)      both i and ii

d)     neither i nor ii


78)    Class can be declared as Abstract class by prefixing the keyword __________

Ans: abstract


79)    We can’t use final in __________

a)      class

b)      methods

c)      variable

d)     constructor


80)    Can we use operators in for loop?

a)      we can’t use it for loop

b)      we have to declare it before, when we use it

c)      Infinite loop

d)     None of  the above


81)    Locks in oracle can be ___________

a)      Row level

b)      Table level

c)      Both row and table

d)     None of  the above


82)    TABLESPACE is _______________

a)      Default system space is called tablespace

b)      Each user may have tablespace

c)      There is no concept called TABLESPACE in oracle

d)     Collection of DataBases




84)    The Function of LGWR

85)    Which file is responsible for transaction recovery?

a)      data file

b)      control file

c)      redologfile

d)     archive file


86)    What will getparametervalue() will return?

87)    When will the scriplet tag(<%      %>) will execute?

a)      compilation time

b)      run time

c)      translation time

d)     none


88)    What will int=execute() do?

a)      compiler error

b)      runtime error

c)      It wont return any value

d)     none



89)     What will int=executeQuery() do?

a)      compiler error

b)      runtime error

c)      It wont return any value

d)     none


90)    What will int=executeupdate() do?

a)      compiler error

b)      runtime error

c)      It wont return any value

d)     none


91)    Interface I1{ }//line1

Interface I2{ }// line 2

Interface I1 extends I2//line3


Which line(s) produce the error?

a)      line 1 & 2

b)      line 3

c)      line 2

d)     all the three


92)    What are the comments available in java?

  1. Single Line Comment
  2. Multi Line Comment
  3. Documentation Comment
  4. All the above


Post a Comment

0 Comments