• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Question about DisplayMode  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I've started reading 'Fundamental 2D Game Programming with Java' and came across this code snippet;



What I don't quite understand is what is happening at this line


 
Java Cowboy
Sheriff
Posts: 16084
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you explain in more detail what you don't understand about that line?

other is a DisplayModeWrapper object. It has a member variable named dm (which is probably of type DisplayMode) and class DisplayMode has a method getWidth() which is being called on the object that other.dm refers to.

It's exactly the same as System.out.println(...) - class System has a member variable named out (which is an OutputStream) on which the method println is called.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!