what is an object and how do you allocate memory to it?
Answers were Sorted based on User's Feedback
Answer / janet
Object is an instance of a class and it is a software unit
that combines a structered set of data with a set of
operations for inspecting and manipulating that data. when
an object is created using new operator,memory is allocated
to it.
| Is This Answer Correct ? | 14 Yes | 4 No |
Answer / devarathnam
Hi... An object is nothing but instance of the class,or
basic run-time entity.By using "new" operator we can
allocate the memory of an object
| Is This Answer Correct ? | 9 Yes | 2 No |
Answer / shilpi
object is intance of class whicch use to access data member and data funtion of class.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / venkatesh
object is a run time entity.by using new keyword we can
allocate memory to it.
| Is This Answer Correct ? | 6 Yes | 0 No |
Object is an instance of the class.There are two ways by
which a new object is created.
1.using new operator.
example:
classname objectname=new classname;
This allocates the memory to objectname.
This can be classname objectname by which null values are
set to the objectname and not the values as in the class.
2.without using new operator.
Declare the variables as static and also methods used as
static and by using the keyword static we can create an
instance of the class.
Thus, we use public static void main(String args[])in main
program where theres no need to create a class and also
instance of class using new operator.
| Is This Answer Correct ? | 8 Yes | 3 No |
Answer / sunitha
It is an instance of class or run time entity which binds
data members and methods together.
example:
car
Attributes(state of the object)
name, no. make , price, mileage.
Methods (Behavior of the object): start, stop,
Accelerate,
By using new operator we can allocate memory to object.
by using constructions we can allocate memory directly
here we no need to use new operator . for deal location of
memory we can use destruction's .
| Is This Answer Correct ? | 2 Yes | 1 No |
Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?
what are the differences between java and .net?..why u choose java?
Explain constructors and types of constructors in java.
What is 'finally' method in Exceptions?
Explain all java features with real time examples
What is currentthread()?
Java openings 3 - 5 years, Lnt Infotech. requirements - core java, J2ee, struts, hibernate Interview Date:- 19 March 2011 Time:- 9:00 AM to 12:00 Pm Interview Location - L & T Infotech, Manapakkam, Chennai Refererral PS NO:- 291649 (Please mention this when u fill the form only then u will be considered for interview) Documents Required:- Latest Resume, Photograph and last 3 payslips Mail me on vasan2211@gmail.com once u appear for interview
What is string syntax?
Can an abstract class be final?
what is the difference between abstract class and Interface?where we can use it in realtime projects?
23 Answers Agile Software, Cognizant, IBM, Innodata, Logica CMG, Mitosis, Nagarro, Value Chain,
What is core java used for?
hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea