Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

Object Reference Instance Variables
In the object Reference instance Variables are very diff , we can see in this code : 
public class Book {
private String title;
public String getTitle() {
return title;
}
public static void main(String [] args) {
Book b = new Book();
System.out.println("The title is " + b.getTitle());
}
}
The output of this code is : 
The title is null
           In this output title is not a explicitly initialised with a string assignment, so the instance variable value is null. 
Posted By: Name:Rajesh Kr URL: Object Reference Instance Variables