Student s = new Student("Joe",20);
is an object of class Student. Can we say s is an object reference
class Student?
s is not an object, it's a variable which contains a reference to an object.
Objects don't have names, just types and locations in memory (and, of course,
fields and methods). Read your statement as: Create a new Student object in
memory, initializing it with the data sent as arguments to a constructor, and
when created, assign a reference to that object to the Student variable s. s
is a reference or object type variable which may reference a Student object or
an object of any subclass of Student.
Take another statement: int x = s.getValue();
Read this statement as "Go to the object referenced by variable s and execute
its getValue() method. Assign the return from that method to the int variable
x."
Subscribe to:
Post Comments (Atom)
Topics
- ActionScript (1)
- Ajax (1)
- Apache mod_SSL (1)
- Apache SSL (2)
- Backup a Certificate (1)
- CA (1)
- connection pooling (1)
- cryptography (1)
- CSR (1)
- CSR Generation Instructions- Tomcat (1)
- Database Connection Pooling with Tomcat (1)
- datasource connection (1)
- Difference between equals and hashCode method (1)
- Difference between JDBC and hibernate (1)
- Difference between String StringBuffer and StringBuilder (1)
- Different types of SQL Joins (1)
- digital certificate (1)
- Digital Certificate Enrollment (1)
- digital certificate installation (1)
- DOM (2)
- DTD (1)
- encryption (1)
- Events in Flex (1)
- Flex Data Access (1)
- generate certificate (1)
- Good Java Interview questions (1)
- Hibernate (1)
- Hibernate Interview questions (1)
- Hibernate Interview questions 1 (1)
- Hibernate Interview questions 2 (1)
- Hibernate Interview questions 3 (1)
- Hibernate Vs. iBatis? (1)
- https (2)
- Import Certificate (1)
- Java Web development interview questions (1)
- JavaInterviewQuestions (1)
- JavaScriptAJAXinterview (1)
- jdbc connection (1)
- JDBC Questions 1 (1)
- JDBC Questions 2 (1)
- JSP interview questions (1)
- Junit (5)
- links (1)
- Move a Certificate (1)
- Multithreading (1)
- MXML (1)
- private key (1)
- public key (1)
- Running multiple Tomcat instances on one server (1)
- SAX (1)
- SCHEMA (1)
- Secure Socket Layer (1)
- Servlet Questions 1 (1)
- Servlet Questions 2 (1)
- Servlet Questions 3 (1)
- ShellScriptingquestions (1)
- Simple Java Questions (1)
- Singleton Design Pattern (1)
- siteminder sso netegrity (1)
- SSL (3)
- StringBuffer versus String (1)
- Third Normal Form (1)
- Unix (1)
- What is connection pooling? (1)
- What's the difference between "PreparedStatement" and "Statement"? (1)
- What's the differences between object and object references? (1)
- XML (1)
- XML Questions 1 (1)
- XML Questions 2 (1)
13 comments:
You are absolutely amzing, absolutely. I m newbie to programming and have a few knowledge on the basic things but the way you explained the coding is better, by a country mile, than what i have got from any of professors till now. Keep up the good work sir, will bw following your blog timely now on.
You are absolutely amzing, absolutely. I m newbie to programming and have a few knowledge on the basic things but the way you explained the coding is better, by a country mile, than what i have got from any of professors till now. Keep up the good work sir
You are absolutely amzing, absolutely. I m newbie to programming and have a few knowledge on the basic things but the way you explained the coding is better, by a country mile, than what i have got from any of professors till now. Keep up the good work sir
Its really good.
This makes complete sense, thanks so much.
simple and precise...
your explanation is better than 1000 books. short and concise. Thanks, it really helps me to understand what books call "reference object".
Evariste
GREAT explanation! I especially like how you explain as if you were "talking it through." That's the hardest part of learning CS for me. If someone would just tell me how I should "think of it"/"talk it through to myself" this would be tons easier.
Great explanation Sir! Thanks a lot ..
Thanks you boss!
it is a simple way to underatand the major diff bw object and reference...
keep answering the que in the simple way....
thank u sir, u have given very excellent and in depth answer which everyone can understand.....its a precious thing which must be archived
greate understanding for the topic
"object doesn't have name"
thank you sir
thank's for clear object and refrence
Post a Comment