wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Interview question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Interview question" Watch "Interview question" New topic

Interview question

surya praveen

Joined: Aug 11, 2008
Posts: 3
hi ,
Can anyone explain "how can we explain object and class using real time exmples?"
Martijn Verburg

Joined: Jun 24, 2003
Posts: 3274

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.

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2716

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.

|Asking Good Questions|
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

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.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41114
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 ]

Ping & DNS - my free Android networking tools app
K. Tsang

Joined: Sep 13, 2007
Posts: 2242

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.

jQuery in Action, 2nd edition
subject: Interview question
Similar Threads
mock exam question
overload question
how can i print an xml document through dom api
UML 486 Question