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
Friday, 29 April 2016
Tuesday, 26 April 2016
Java EE Servlets
Introduction
I've been taking a short break before moving on to new challenges. With this occasion I'm tidying several older personal projects. Among these, my Haiku Gallery.I resumed the review from watching again "Intro to Java. Unit 14. Intro to Java EE. GlassFish. Servlets." by Yakov Fain:
After reading Lesson 26 of Java Programming 24-Hour Trainer I wrote the vote servlet, adapted the client side of my application, packed everything in a WAR file using Eclipse IDE, and uploaded the archive to the Azure Cloud. As illustrated below.
The Client Side of VoteMyHaiku App
The Servlet
Vote My Haiku in the Azure Cloud:
http://votemyhaiku.azurewebsites.net/Conclusions
1. I love Visual Studio Online "Monaco"!2. Adam Bien is right: Java EE is easier than Javascript.
Homework (to self)
1. Warming up: Respond with beautiful HTML from the Vote Server Servlet.2. Advanced: Persist votes in an SQL database. Re-order haiku pieces dynamically, based on voting results, and create a 'Top 3' section on the page.
Friday, 1 April 2016
Angular 2 Random Quote Generator, Step 1
I started coding freeCodeCamp's project titled 'Build a Random Quote Machine'.
Here's the first iteration:
My textbook for learning Angular 2 is Angular 2 Development with TypeScript, by Yakov Fain and Anton Moiseev.
P.S. Today is April Fool's Day. Stay foolish! (Steve Jobs)
Here's the first iteration:
My textbook for learning Angular 2 is Angular 2 Development with TypeScript, by Yakov Fain and Anton Moiseev.
P.S. Today is April Fool's Day. Stay foolish! (Steve Jobs)
References
Subscribe to:
Posts (Atom)