• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interview question

 
surya praveen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
Can anyone explain "how can we explain object and class using real time exmples?"
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by surya praveen:
hi ,
Can anyone explain "how can we explain object and class using real time exmples?"


See http://en.wikipedia.org/wiki/Class_(computer_science)
See http://en.wikipedia.org/wiki/Object_(computer_science)

As for 'real time examples' you could discuss the concept of an 'Event', e.g. An Event class represents trade events flowing through a financial system in real time, an instance of that Event class is the object.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly please UseAMeaningfulSubjectLine for your topic.
This is your second thread with the same subject "Interview question".
Regarding your question, an object can be a student with roll number 123
whereas student itself is a class.
Please take some time to read the ask good question link below.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm. I don't want to sound discouraging, but if you struggle with this question in an interview, you are probably not ready to be interviewing for a Java job.

Rather than go through that pain, have a read through the Java tutorial. This covers the basics. You might also Google for "Thinking In Java" which is a good, free book about the language.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for 'real time examples' you could discuss the concept of an 'Event'

I'm fairly certain that what is meant here are "real world examples", not "real time examples".
[ August 11, 2008: Message edited by: Ulf Dittmer ]
 
K. Tsang
Bartender
Posts: 3443
13
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Paul. If you ask this. Why not ask can a car for example be an "object"? Can car be a "class"?

Ultimately I personally think, anything can be object and/or class depending on how you look at it. It's like if it "has" attributes then it's a class/object. If it can't have any lower-denominated attribute (so to speak) then it can't be class/object.

Simple definition in real life is object=physical representation and class=logical representation of something.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic