Java
For the purposes of this discussion, Sun Microsystems’ Java is a moderately complex, object-oriented language similar to C. Java has both strong and static typing. In one way, Java is more object oriented than Ruby is: A programmer coding in Java must use an object-oriented paradigm for his own programs. On the other hand, Java is less object oriented than Ruby is in the way that it implements its own built-in features. For example, to get the absolute value of the integer 100 in Java, you would do this:
Math.abs(100)
This means that the programmer wants to use a method called abs, which is associated with Math, to perform that method’s action on the integer 100. The equivalent operation in Ruby would be performed as follows:
100.abs
Using Ruby’s ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access