The Artima Developer Community
Sponsored Link

Java Answers Forum
Can u answer these

1 reply on 1 page. Most recent reply: Apr 16, 2003 5:36 AM by Sriram

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Sriram

Posts: 4
Nickname: planswerme
Registered: Apr, 2003

Can u answer these Posted: Apr 7, 2003 3:34 AM
Reply to this message Reply
Advertisement
Recently I had been to a interview some questions are :
Can u any one answer these?

a. Which is true?
1 An inner class cannot extend Super Class
2 An inner class cannot implement interface
3 An inner Class can extend a Super Class and interface
4 An ic can implement SC and interface

b. When invoking loadClass() of a class , if parent Class loader of class under consideration returns null then
a) Class not found exception
b) Null pointer exception
c)class loading in builtin JVM is used
d) Nothing happens, pgm continues

c. Version setting of cookie is by:
cookieobj.setVersion(Cookie c , int v);
responseobj.setCookie(Cookie c , int v);
responseobj.addCookie(Cookie c , int v);
none

d. Transaction is rolledback if system Exception is thrown :
True/false.

e. Transaction is rolledback if application Exception is thrown : True/false.


f. Native modifier: can be applied
to class,
to method,
class variable,
instance variable which is valid?

g. What is meant by native modifier?

h. Which is transaction attribute for MsgDrivenBean? NotSupported,REquired, Mandatory

i. Public class TestServlet extend HttpServlet implements SingleThreadedModel
{
private static int num=5;
public doGet(HttpServletRequest req, HttpServletRes res)
{}
}
Which is thread safe?
num and req,
num and req both not,
num alone, req alone.
all

j. Which is slowest access to an elt in middle of alist by means of index?
Array, Vector,ArrayList, LinkedList, All, none.

k. Write a Java program in which a Thread A reads from a file F1 and thread B
writes the contents into the File F2.


Sriram

Posts: 4
Nickname: planswerme
Registered: Apr, 2003

Re: Can u answer these Posted: Apr 16, 2003 5:36 AM
Reply to this message Reply
> Recently I had been to a interview some questions are :
> Can u any one answer these?
>
> a. Which is true?
> 1 An inner class cannot extend Super Class
> 2 An inner class cannot implement interface
> 3 An inner Class can extend a Super Class and interface
> 4 An ic can implement SC and interface
>
> b. When invoking loadClass() of a class , if parent Class
> loader of class under consideration returns null then
> a) Class not found exception
> b) Null pointer exception
> c)class loading in builtin JVM is used
> d) Nothing happens, pgm continues
>
> c. Version setting of cookie is by:
> cookieobj.setVersion(Cookie c , int v);
> responseobj.setCookie(Cookie c , int v);
> responseobj.addCookie(Cookie c , int v);
> none
>
> d. Transaction is rolledback if system Exception is
> thrown :
> True/false.
>
> e. Transaction is rolledback if application Exception is
> thrown : True/false.
>
>
> f. Native modifier: can be applied
> to class,
> to method,
> class variable,
> instance variable which is valid?
>
> g. What is meant by native modifier?
>
> h. Which is transaction attribute for MsgDrivenBean?
> NotSupported,REquired, Mandatory
>
> i. Public class TestServlet extend HttpServlet implements
> SingleThreadedModel
> {
> private static int num=5;
> public doGet(HttpServletRequest req, HttpServletRes res)
> {}
> }
> Which is thread safe?
> num and req,
> num and req both not,
> num alone, req alone.
> all
>
> j. Which is slowest access to an elt in middle of alist
> by means of index?
> Array, Vector,ArrayList, LinkedList, All, none.
>
> k. Write a Java program in which a Thread A reads from a
> file F1 and thread B
> writes the contents into the File F2.

Flat View: This topic has 1 reply on 1 page
Topic: Serious package misunderstanding! Previous Topic   Next Topic Topic: java works with files

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use