| Back to Questions Page |
| |
| Question |
could you run the java program without main method? |
Rank |
Answer Posted By |
|
Question Submitted By :: Naga |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | yes,we can write and run a java program without using the
main method.
i.e By using static
example program...!
public void static( )
public class
{
public void static( )
{
System.out.println( "Without main method" );
System.exit(0);
}
}  |
| Naga |
| |
| |
| Question |
Accenture NJ mostly ask question on Collection like
1)How to sort Objcts and how treeset sort them
2)Explain mechanism of Hashcode finding in Java
3)Name some of the Sorted collection. |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The answer to all this question is easy but i think they
want answer from internal mechanism how it works inside
Java!!!
You think you answered well but they will always fail you
just hate then  |
| Guest |
| |
| |
| Question |
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.
|
Rank |
Answer Posted By |
|
Question Submitted By :: Rakesh |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Compilation fails because of an error on  |
| Harish |
| |
| |
|
|
| |
| Answer | Three will be the answer.  |
| Amit Mittal |
| |
| |
| Question |
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
|
Rank |
Answer Posted By |
|
Question Submitted By :: Rakesh |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | any class  |
| Dilip |
| |
| |
| Answer | any class in the test package  |
| Ram |
| |
| |
| Answer | any class that extends Taget  |
| Lakshman |
| |
| |
|
| |
|
Back to Questions Page |