Question { Ness Technologies, 6803 }
Nullpointer exception is a very common exception. Why is it
not made as a checked exception?
Answer
Is This Answer Correct ? | 18 Yes | 0 No |
Question { Ness Technologies, 15439 }
When you say String is immutable, what do you mean by that?
Say I have String s = "Ness"
s= s+"Technologies";
What will happen? If the value gets appended, then what is
the meaning of immutable here?
Answer
Is This Answer Correct ? | 11 Yes | 0 No |
Question { 4623 }
who can we create the object of a class? in how many ways we
can create it (max 5)
Answer
Is This Answer Correct ? | 1 Yes | 0 No |
Can u write constructor in abstract.If yes den when it will
be invoked.
Answer
Is This Answer Correct ? | 2 Yes | 1 No |
Question { 13358 }
Hi Friends, can u give me Real Time example for interface
and abstract class.(With Banking Example)
Answer
Is This Answer Correct ? | 6 Yes | 0 No |
Question { 4786 }
Hi Friends, I am beginner in java. what i know about
synchonized keyword is,If more that one 1 thread tries to
access a particular resource we can lock the method using
synchronized keyword. Then after that how the lock is
released and how next thread access that.Please explain with
example.
Answer
Is This Answer Correct ? | 0 Yes | 0 No |
Question { 4786 }
Hi Friends, I am beginner in java. what i know about
synchonized keyword is,If more that one 1 thread tries to
access a particular resource we can lock the method using
synchronized keyword. Then after that how the lock is
released and how next thread access that.Please explain with
example.
Answer
Is This Answer Correct ? | 0 Yes | 0 No |
StringBuilder s = new StringBuilder("Hello
Mom");s.append(",I mean,Mother");
Response.Write(s.ToString());
String s = "Hello Mom";
s+ = ",I mean Mom";
Response.Write(s);
Which is faster ? which uses the most memory?
Answer
Is This Answer Correct ? | 1 Yes | 0 No |
Question { 21216 }
Given:
10. interface A { void x(); }
11. class B implements A { public void x() { } public
voidy() { } }
12. class C extends B { public void x() {} }
And:
20. java.util.List list = new java.util.ArrayList();
21. list.add(new B());
22. list.add(new C());
23. for (A a:list) {
24. a.x();
25. a.y();;
26. }
What is the result?
1 Compilation fails because of an error in
line 25.
2 The code runs with no output.
3 An exception is thrown at runtime.
4 Compilation fails because of an error in
line 20.
Answer
Is This Answer Correct ? | 9 Yes | 4 No |
Question { 17449 }
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
Is This Answer Correct ? | 9 Yes | 3 No |
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
Is This Answer Correct ? | 1 Yes | 0 No |