Quantcast
Channel: Dario Pardo's cave » Basics
Viewing all articles
Browse latest Browse all 2

So, everything in Java is an Object?

0
0

For this example I am going to refer to a POJO thatI created in another post: Objects: equals() + hashCode() + toString()
Open up a command prompt, navigate to the directory where the SoccerPlayer.java file is located and run the following commands:

  1. Compile the source code by typing javac *.java
  2. Run the Java Class File Disassembler by typing javap SoccerPlayer
  3. You should get the following:

Notice how it states that SoccerPlayer extends java.lang.Object but we did not have to type that in our source file because by default every class in Java IS-A Object


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images