File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Quick Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Quick Question" Watch "Quick Question" New topic

Quick Question

Mark Captain
Ranch Hand

Joined: Nov 01, 2011
Posts: 30
public void printReport(int numberRolls, DiceAccumulator totals)

public boolean equals(Stock object2)

public DiceAccumulator runSimulation(int numberRolls)

The bold word, Why is it not a data type like I have been learning.
John Jai

Joined: May 31, 2011
Posts: 1776
They are references to the classes you cited in bold.

Similar to below where String and Object are the class types

In below the method printDogName() takes the reference that is a type of Dog as its input...

Winston Gutkowski

Joined: Mar 17, 2011
Posts: 8954

Mark Captain wrote:The bold word, Why is it not a data type like I have been learning.

It is.

If, as John says, they are classes, then they're a very specific data type; but something like Stock could just as easily be an interface, in which case it is most assuredly a type, in any sense of the word.


Bats fly at night, 'cause they aren't we. And if we tried, we'd hit a tree -- Ogden Nash (or should've been).
Articles by Winston can be found here
I agree. Here's the link:
subject: Quick Question
It's not a secret anymore!