Showing posts with label Java Quizzes. Show all posts
Showing posts with label Java Quizzes. Show all posts

Friday, 29 April 2016

Order in Initialization

Do you know what the following piece of code will print?




The answer is:

MyClass
Parent
MyClass
Test

Now can you tell which instance (instance1 or instance2) prints the first "MyClass" string?
 
Uncomment the commented lines and see for yourself!

http://stackoverflow.com/questions/14805547/are-fields-initialized-before-constructor-code-is-run-in-java

http://stackoverflow.com/questions/17806342/order-of-constructor-calls-in-multilevel-inheritance-in-java

Sunday, 9 November 2014

Java Quizzes With AngularJS

I played with AngularJS during the last couple of days and started to build a small application to test my Java knowledge. You can play with it too, here.

If you like it, please drop me a Java technical interview-like question in the comments below. I will include your question in the quizzes.

 The HTML source of the application is here, and its controller here.

 Let's have fun while studying Java!