javascript
Brief description  about Online courses   join in Online courses
View punitha  krishnasamy 's Profile

Class and objects

Hi

The following program is an example of class type variable..My question is how to print an output statement for the class type variable.what would be the output for this program.

class HouseClass {

}


public class MainC {
public static void main(String[] args) {
HouseClass property;
property = new HouseClass();

}
}

Asked by punitha krishnasamy | Jul 22, 2012 |  Reply now
Replies (3)
View punitha krishnasamy 's Profile
Thank you saranya and Sujay...
Jul 26, 2012
View saranya k 's Profile
hi punitha..
the code yu mentioned wil nt return an output.. it is jus t syntax sort of stuff of using the class type variable.. here t class type variable is property.. yu use this variable to call the objects and methods of the same class or another class..
Jul 26, 2012
View sujay kumar 's Profile
Hi i am not getting what you exactly asking but you can refer the below example for class type variable and try to enter your complete code for output
public class Test
{
public void Age()
{
int age = 0
age = age + 7
System.out.print"Puppy age is : " + age)
}

public static void main(String args[]){
Test test = new Test()
Test.Age()
}
}
Jul 26, 2012