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 3182

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

1 3423

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

3 4862

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

Wipro,

3 9263

how to create a jar file in java

1 4618

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

2 4699

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

2 3842

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

IBM,

7 10027

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

IBM, Microsoft,

1 4634

why constructor dont have returns type?

IBM,

9 12985

is JVM platform dependent or independent..?

IBM, Tech Mahindra,

11 39055

what is difference between interface and abstract class..?

4 5972

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

Persistent, Societe Generale,

8 33069

what is the collable collections in java?

Persistent,

2 11842

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.

1792


Post New Core Java Questions

Un-Answered Questions { Core Java }

What is matcher in java?

709


Explain when classnotfoundexception will be raised ?

779


Will set allow duplicates in java?

712


What is your platform’s default character encoding?

766


What are disadvantages of java?

729


What is the difference between Java and C++?

817


What is math exp in java?

739


What is void in java?

791


What are the three parts of a lambda expression?

724


How to pass arraylist to stored procedure in java?

742


Give me example of derived data types.

823


What is difference between synchronize and concurrent collection in java?

734


Explain exception chaining in java?

818


How many types of memory areas are allocated by JVM in java?

782


What is join () in java?

707