r/javahelp • u/[deleted] • Nov 20 '15
Why does (Woman instanceof Object) equal true?
This doesn't seem right.
15
4
3
u/marc2912 Nov 20 '15
Every object in java inherits automatically from Object. So for example let's say you make an interface Automobile, and then a class that implements Automobile called Porshe and then another one nested under that that extends Porshe called NineEleven
NineEleven -> Porshe -> Automobile -> Object.
-2
2
u/Philboyd_Studge Nov 20 '15 edited Nov 20 '15
Woman extends my Object, if ya know what I mean
Edit: pun thread? I thought this was a pun thread... Just making a joke... Errr not really a misogynist... sigh
1
0
u/EmmaBourbon Nov 20 '15
This was a fun joke. I like it! We all know that women aren't really objects, that men aren't really sex beasts with uncontrollable urges and that having a sense of humor increases your quality of life.
0
u/ChaoticxSerenity Nov 21 '15
Um... You lost, mate?
To answer OP's question, every class has Object as a superclass. Thus, all objects will extend from Object.
1
0
0
Nov 21 '15
[deleted]
1
u/gliph Nov 22 '15
I find this really interesting and telling. There literally is not a single comment from someone getting defensive.
Except for you, of course.
14
u/vprise Nov 20 '15
Yes but she has class.