Core Java Interview Questions
Questions Answers Views Company eMail

hi to all,i have a question on static block. i saved below as test.java class test extends a { static { System.out.println("test static"); } public static void main(String []dfs) { } } class a { static { System.out.println("a static"); } public static void main(String []asdf) { } } o/p as static test static but if i change base class as test class then class test { static { System.out.println("test static"); } public static void main(String []dfs) { } } class a extends test { static { System.out.println("a static"); } public static void main(String []asdf) { } } o/p test static explain me why "a static" wasn't print in second code when it is in derived class

1 2866

what are the uses of Class class and what it returns? explain it with the example code.

1 3134

class test { private static void main(String []adsf) { } } explain me that the above code is error or exception

3 4282

class a extends b { } class b extends a { } why java doesn't support cyclic pls explain me with example

Wipro,

3 8762

how to create a jar file in java

1 4244

what is the main difference between string and stringbuffer? can you explain it with program?

2 4297

How can i add a button in applet in java ???

2 3451

did interface can implementation method ? i know its not possible but my interviewer said its possible ..but how..? any one have idea ???

IBM,

7 9110

how to make the double-tone class ? as we have singletone class..?

IBM, Microsoft,

1 4241

why constructor dont have returns type?

IBM,

9 11753

is JVM platform dependent or independent..?

IBM, Tech Mahindra,

11 37490

what is difference between interface and abstract class..?

4 5313

How to make a method thread safe without using synchronized keyword?

Persistent, Societe Generale,

8 31981

what is the collable collections in java?

Persistent,

2 11367

we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.

1550


Post New Core Java Questions

Un-Answered Questions { Core Java }

Explain about the main() method in java?

555


What is mnemonic code?

522


Can you extend main method in java?

607


What are the advantages of unicode?

533


How do you sort words in java?

516






what do you understand by the term string with respect to java?

516


What are design patterns and please explain?

559


What is string substring?

551


What are the major drawbacks of external iteration?

558


Why hashmap is used in java?

532


Why is flag used in java?

531


What does %d do in java?

566


What is the access scope of a protected method?

555


What is difference between overloading and overriding in java?

517


What is jvm? Why is java called the platform independent programming language?

527