Max Ho

Greenhorn
+ Follow
since May 06, 2015
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Max Ho

Hi all,

I'm a Javascript developer and have been for a couple of years. I've started working on some java in my job on and off, but want to take it to the next level. As I have come to realise, java and javascript are two very different languages, both with it's pros and cons. Mastering javascript is one thing - understanding it's syntax, functional programming paradigm, javascript frameworks, appreciating the quirks of the language such as type coercion, lexical scoping and closures.

While I've done a little java at my workplace, it's hardly sufficient for me to deeply understand the language. And reading isn't enough as well. For season java developers here, what do you recommend that I do to practice the ins and outs of java?

Thank you.
1 year ago
Hey Josh,

Learnt a great a deal from the 2nd edition of your book and looking forward to your new book!
1 year ago
Great recommendations! Thanks all
1 year ago
Hi Joel,

Congrats on your new book!

I've been playing around with HTML5 Hybrid Mobile App Framework like Ionic. But didn't like the lack of native animation support.

What would you say are the key things that we can learn from your book?

Thanks!

3 years ago
Hi Joel,

Congratulations on your book!
3 years ago
Hi Campbell,

That's interesting because I recently saw that airbnb hires java developers on their data structure, etc.

Fir example - https://www.airbnb.com.sg/careers/departments/position/2284

From what you mentioned about three-layer architecture, are there certain frameworks or ideas that I can read up to learn about?
3 years ago
Hi all,

I've been learning JavaScript & Python in the past year. Seemingly, younger companies(startups) are hiring JS, Python & Ruby on Rails developers (for web dev at least).

Besides the usage of Java in Android apps and Enterprise, where else is Java used in this day and age?

Looking forward to experienced developers' views. Thank you
3 years ago
Great, thank you!
3 years ago
Hi all,

Thanks for all your replies!

Just to probe further, where is a good place to learn best practices for java? Here I suppose - https://docs.oracle.com/javase/tutorial/ ?
3 years ago
Hi all,

I have two questions regarding Java constructors.

1. The first question is regarding no-argument constructors. I was reading this set of notes and was confused by this no-argument constructor created in the notes. In the code below, it created the public Point() no-arg constructor. However, it assigns 0 and both x and y. In this case, why isn't x and y referred to as this.x and this.y? And if x and y is referred to in this no-arg constructor, are they even valid?


http://www3.ntu.edu.sg/home/ehchua/programming/java/J3b_OOPInheritancePolymorphism.html



2. My second question is what is the correct way of creating multiple constructors? Some use this(x,y,z) while other use this.x, this.y in the body of the constructor.

Thank you!
3 years ago
Ah yes, that's what I thought after going through google. Thanks!

Junilu Lacar wrote:

Max Ho wrote:so I am wondering why the need to explicitly call super() in the Quantity constructor.


There's no need. If you don't call it explicitly, it will be called implicitly anyway.

4 years ago
superclass is the object class.

I've not come across classes that invoke the object class constructor. There isn't arguments in the object class, so I am wondering why the need to explicitly call super() in the Quantity constructor.

Campbell Ritchie wrote:No superclass is named, so the immediate superclass is .....

All Java® programmers should know that.



EDIT: I found an answer from you from 4 years back - http://www.coderanch.com/t/535754/java/java/subclass-call-constructor-super-class

The details are in the Java™ Language Specification. But it is reluctant to open for me.

Simply: yes. You must initialise all the fields, so as to create your instance in a consistent state, ie fulfilling its class invariants. The only instance where you can get away without a super(...); call is if the superclass has an accessible no-arguments constructor. One must presume that constructor will put the superclass object into a consistent state.
I think the only state in which case it is good design not to initialise the fields in the superclass is when the superclass hasn't got any fields!

4 years ago
Hi Campbell,

Thanks for your reply.

Isn't public Quantity(double value, Unit unit) the constructor for Quantity class? Which is the superclass?



Got the second part, thanks!
4 years ago
Hi Junilu,

Sorry for my late reply. Got busy with something else, and hadn't had time to sit down to read through your replies.
What you had explained makes sense to me.

I have two more questions if you don't mind.

1st Question - How is it that the object pints is created without the new keyword?


2nd Question - Why is super(); invoked here when there isn't a parent constructor?


Thank you!
4 years ago