Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Aditi Msc   on Nov 12 In Java Category.

  
Question Answered By: Teresa Rogers   on Nov 12

This is the code you gave me earlier:
pArea = new polyArea(this,(float)10000.0)
The section of the code (float)10000.0 is saying that you want to ensure that
the number 10000.0 is stored as a float. The reason for this is because methods
require numbers to be a certain form, whether it be float, double, int, etc.
This is just making sure it is a float. the same could be 10000.0f. so the code
could look like this instead:
pArea = new polyArea(this, 10000.0f);

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 


Tagged: