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 { Infosys, 19061 }

Given:
1. package test;
2.
3. class Target {
4. public String name = “hello”;
5. }
What can directly access and change the value of the
variable name?
1 any class
2 only the Target class
3 any class in the test package
4 any class that extends Target


Answer

Public is Visible to everywhere.
Private is visible to only the same class.
Protected is visible in same package and also sub classes in
any package.

Is This Answer Correct ?    3 Yes 0 No

Question { 15843 }

Given:
11. public static void main(String[] args) {
12. Integer i = uew Integer(1) + new Integer(2);
13. switch(i) {
14. case 3: System.out.println(”three”); break;
15. default: System.out.println(”other”); break;
16. }
17. }
‘What is the result?
1 three
2 other
3 An exception is thrown at runtime.
4 Compilation fails because of an error on
line 12.


Answer

In the line 12 .jus think new Integer(1) will result 1 and
new Integer(2) will result 2 so 1+2=3 which is stored in a i.

so the line 12 can b written as a Integer i=1+3;

Is This Answer Correct ?    4 Yes 1 No


Question { 15843 }

Given:
11. public static void main(String[] args) {
12. Integer i = uew Integer(1) + new Integer(2);
13. switch(i) {
14. case 3: System.out.println(”three”); break;
15. default: System.out.println(”other”); break;
16. }
17. }
‘What is the result?
1 three
2 other
3 An exception is thrown at runtime.
4 Compilation fails because of an error on
line 12.


Answer

In the line 12 .jus think new Integer(1) will result 1 and
new Integer(2) will result 2 so 1+2=3 which is stored in a i.

so the line 12 can b written as a Integer i=1+2;

the answer is 1) three

Is This Answer Correct ?    5 Yes 1 No

Question { 8349 }

Can an interface extands a class?


Answer

No,Interface can't extends class.It ll throw compile time
exception.

can
class extends class
class implements interface,interface,...
interface extends interface

can't

class extends class,class
interface implements class

Is This Answer Correct ?    9 Yes 0 No

Question { 11053 }

PreparedStatement is a pre compiled statement but where it's
pre compiled ?


Answer

thanks aravind.

Is This Answer Correct ?    5 Yes 1 No

Question { 6238 }

all are saying java doesn't support multiple inheritance but
by default Object class is super class for all the user
defined classes and we can extend atmost one class so each
class can extend more than one class so java supports
multiple inheritance?i am confused with this,pls any one
explain me.


Answer

Hello Mr.Kartik Naidhruva.I m not asking this is foolish or
not.i jus asking to explain.even though the question is
foolish don't answer like fool.jus explain how my question
is wrong that's better.jus explain about Object class

Is This Answer Correct ?    4 Yes 0 No

Prev    1   2    [3]