• Post Reply Bookmark Topic Watch Topic
  • New Topic

What does an Object contain  RSS feed

 
Saad Zahoor
Ranch Hand
Posts: 82
Android
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question :   what are Objects in java i mean what value they contain ? .Like int contain numbers and String contain Words etc
 
Campbell Ritchie
Marshal
Posts: 56545
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you suggesting an int is an object?
 
Tim Cooke
Marshal
Posts: 4044
239
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I propose the Java Tutorials: Classes and Objects would be a good starting place to get to grips with this concept.
 
Saad Zahoor
Ranch Hand
Posts: 82
Android
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


wanna know about this kind of object !! What kind of value it contain .. Int contain : 3144232 (number) . String contain : euyruiewfknf(Alphabets)
 
Saad Zahoor
Ranch Hand
Posts: 82
Android
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Liutauras Vilda
Sheriff
Posts: 4917
334
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Slow down cowboy. Have you gone through the tutorial Tim gave you?

Think that Object can be anything what you define. It is like a big box, which can contain pretty much anything. For example you put a lot stuff in a metal thing and call it a fridge, it has screws, it has shelves, it has freezer and so on.

You can name your class ComputerMouse, add to it its all characteristics, and call it as you call it. And in general it is called a ComputerMouse object (once you instantiate it ... new ComputerMouse(...) ) with its all internals. It could be something single inside (as number of buttons), it could be many things inside as its color, dpi, ... i.e.
 
Saad Zahoor
Ranch Hand
Posts: 82
Android
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks that's Helpfull .. Clear my confusion
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!