manikandan


{ City } vellore
< Country > india
* Profession *
User No # 41088
Total Questions Posted # 2
Total Answers Posted # 36

Total Answers Posted for My Questions # 1
Total Views for My Questions # 6649

Users Marked my Answers as Correct # 229
Users Marked my Answers as Wrong # 109
Answers / { manikandan }

Question { IBM, 26910 }

Can u overload main()method.Give with example.


Answer

yes,gothrough below code.

class test
{
public static void main(String []asdff)
{

test.a();

}
public static void main(int a,int b)
{
System.out.println("over loaded");
}
static void a()
{

test.main(1,2);
}
}

Is This Answer Correct ?    40 Yes 12 No

Question { 10125 }

what is an object class?Explain its methods?


Answer

we not need to extend a Object class,implicitly it ll extend
at run time

Is This Answer Correct ?    4 Yes 2 No


Question { Accenture, 17772 }

What is Session and cookies?Explain in detail with an
example?


Answer

Session,Keeps a track of a User activities across the web pages.

Cookies,it is a small text file creates by a application
server and stored in a client environment.it stores a client
id and cookies can b read by appropriate application server

Is This Answer Correct ?    12 Yes 1 No

Question { 7828 }

Real Time sample code for Encapsulation and Abstraction.
where to use abstract and where to use specifies like
public private.


Answer

Encapsulation is used when v need to use a data with the
object access.
Abstraction is used when v need to restrict the end user to
access all process.

Is This Answer Correct ?    1 Yes 10 No

Question { Excel, 6157 }



what is mean by RMI ?
Please answer me.
Advance thanks.


Answer

RMI is a remote method Invoking,By using RMI we can work
with a remote object which is present in another system with
different JVM.which uses a RMI-IIOP.

Is This Answer Correct ?    5 Yes 1 No

Question { 11164 }

why business logic written using servlets not in jsp. Jsp
used for presentation purpose. serlvet used for coding
business logic and controller logic. Reason for using
servlets in business logic.


Answer

jsp files are converted to a servlet file it can b read any
one but servlet files are compile to .class file that so
servlet is used for business logic and jsp are not

Is This Answer Correct ?    5 Yes 7 No

Question { 3978 }

How to send a request to garbage collector?


Answer

we can't force a garbage collection.it automatically runs
when system runs out of memory.

Is This Answer Correct ?    2 Yes 1 No

Question { 16922 }

howmany types in garbage collection


Answer

i exactly dont know the answer but garbage collection is a
cleanup process.it automatically runs in a background.(and i
think there is no types am not sure}

Is This Answer Correct ?    6 Yes 24 No

Question { 3933 }

life cycle of an applet?


Answer

init()
start()
stop()
Destroy()

Is This Answer Correct ?    5 Yes 0 No

Question { Accenture, 6734 }

what is the Yield() method used in threads?


Answer

after invoking yeild() method it enters into a ready state.

Is This Answer Correct ?    1 Yes 0 No

Question { Cognizant, 13916 }

What is Hash Code in Java?


Answer

hash code is unique for each and every object.this like a
index or a address to identify a object.

Is This Answer Correct ?    15 Yes 24 No

Question { 3693 }

I have written a program to connect to database using
odbc.Can this Application run on any Platform????


Answer

this can run on any platform which supports odbc .

Is This Answer Correct ?    0 Yes 2 No

Question { 16177 }

10. class Nav{
11. public enum Direction { NORTH, SOUTH, EAST, WEST }
12. }
13. public class Sprite{
14. // insert code here
15. }
Which code, inserted at line 14, allows the Sprite class to
compile?
a)Direction d = NORTH;
b)Nav.Direction d = NORTH;
c)Direction d = Direction.NORTH;
d)Nav.Direction d = Nav.Direction.NORTH;


Answer

Answer is d)Nav.Direction d = Nav.Direction.NORTH;

explanation:

enum is specified inside a class Nav and that can b called
from other class that so v use the reference of the class
Nav.it's jus shows Encapsulation concept

Is This Answer Correct ?    8 Yes 3 No

Question { 14670 }


33. try {
34. // some code here
35. } catch (NullPointerException e1) {
36. System.out.print(”a”);
37. } catch (RuntimeException e2) {
38. System.out.print(”b”);
39. } finally {
40. System.out.print(”c”);
41. }
What is the result if a NullPointerException occurs on line
34?
1 c
2 a
3 ab
4 ac


Answer

the answer is 4) ac

because if NullPointerException occurs in a try block it
search for a revelant Exception type so "a" gets printed
then finally ll execute at last and prints c.this both ll
print in same line bcas we didnt use next line that so.

use this code for clear understanding.

class test
{
public static void main(String[]asd)
{
try {
test t=null;
t.a(); //exception occurs in this step

} catch (NullPointerException e1) {
System.out.print("a");
} catch (RuntimeException e2) {
System.out.print("b");
} finally {
System.out.print("c");
}

}
void a()
{

}
}
output:ac

note: if v use RunTimeException b4 the NullPointException it
ll throw the compile time Exception bcas RUnTImeException is
super class for NullPointerException so it ll handel All
it's subclass Exception.

Is This Answer Correct ?    14 Yes 0 No

Question { 17473 }

11. static class A {
12. void process() throws Exception { throw new Exception();
}
13. }
14. static class B extends A {
15. void process() { System.out.println(”B”); }
16. }
17. public static void main(String[] args) {
18. new B().process();
19. }
What is the result?
1 B
2 The code runs with no output.
3 Compilation fails because of an error in
line 12.
4 Compilation fails because of an error in
line 15.


Answer

Answer is 1)B because we directly calling a process method
in class B

Is This Answer Correct ?    5 Yes 2 No

Prev    1    [2]   3    Next