Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Quick Question" Watch "Quick Question" New topic
Author

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
Bartender

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
Bartender

Joined: Mar 17, 2011
Posts: 7549
    
  18

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.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
jQuery in Action, 2nd edition
 
subject: Quick Question
 
Similar Threads
Default constructor
Help Creating Class
what is solution for this??
Thread question
Threas - Object Locks Question