reference

reference

hi i have one doubt

i wrote 2 classes student and person. in that i have only one methos with same name show(). these two classes are independent meaniig no inheritance or any thing.

i wrote another class with name Sample(main()) in that i create 2 objects.

in that i want to store object reference of student into person can do like this or any other alternative

Student st=new Student(); Person p=new Person(); p=(Person)Student; p.show();

what mistake i have done in this can u please assist me

regard

jilani

View Answers

Ads









Related Tutorials/Questions & Answers:
reference
reference of student into person can do like this or any other alternative Student
Version of reference>reference dependency
List of Version of reference>reference dependency
Advertisements
by value or by reference
by value or by reference  Are objects passed by value or by reference
appdelegate reference
appdelegate reference  Hi, How to get the reference of appdelegate in my view controller class. Thanks.   Hello Friend, Following code example show how to get appdelegate reference anywhere in your iPhone/iPad
cross reference
cross reference   hi everbody as i got a problem and i have no idea the problem that i need to create a cross reference map for a Java source file... generation of the cross-reference map. Finally, the cross-reference map is output
Artifacts of reference
List of Artifacts of reference maven depenency
pointer to a reference
pointer to a reference  pointer to a reference in C++    #include <iostream> using namespace std; void foo1(int& x) { int* p = &x; *p = 123; } void foo2(int* x) { int
pointer to a reference
pointer to a reference  pointer to a reference in C++    #include <iostream> using namespace std; void foo1(int& x) { int* p = &x; *p = 123; } void foo2(int* x) { int
pass method reference in java
pass method reference in java  How to pass method reference in Java
Is Java pass-by-reference?
Is Java pass-by-reference?  Is Java pass-by-reference
ModuleNotFoundError: No module named 'reference'
ModuleNotFoundError: No module named 'reference'  Hi, My Python... 'reference' How to remove the ModuleNotFoundError: No module named 'reference' error? Thanks   Hi, In your python environment you
Maven Dependency reference >> 1.0
You should include the dependency code given in this page to add Maven Dependency of reference >> reference version1.0 in your project
Maven Dependency reference >> 1.0.1
You should include the dependency code given in this page to add Maven Dependency of reference >> reference version1.0.1 in your project
Maven Dependency reference >> 1.0.2
You should include the dependency code given in this page to add Maven Dependency of reference >> reference version1.0.2 in your project
Maven Dependency reference >> 20050206.203826
You should include the dependency code given in this page to add Maven Dependency of reference >> reference version20050206.203826 in your project
Maven Dependency reference >> 20050208.124733
You should include the dependency code given in this page to add Maven Dependency of reference >> reference version20050208.124733 in your project
Declare Reference variable
Declare Reference variable   class A { int a; //instance... is shared. I just want to ask if we declare Reference variable above then what does...?? (Generally we used to declare reference variable in main method at the time
Reference passing in java
Reference passing in java  plz tell me wat d meaning of refernce in java? for example : Class M(){ N n; } Class N(){ } wats dis meaning
Object reference not set to an instance of an object
Object reference not set to an instance of an object  Object reference not set to an instance of an object
difference between hashcode,reference in java
difference between hashcode,reference in java  difference between hashcode,reference in java
ModuleNotFoundError: No module named 'ambition-reference'
ModuleNotFoundError: No module named 'ambition-reference'  Hi, My... named 'ambition-reference' How to remove the ModuleNotFoundError: No module named 'ambition-reference' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'ambition-reference'
ModuleNotFoundError: No module named 'ambition-reference'  Hi, My... named 'ambition-reference' How to remove the ModuleNotFoundError: No module named 'ambition-reference' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'edc-reference'
ModuleNotFoundError: No module named 'edc-reference'  Hi, My... 'edc-reference' How to remove the ModuleNotFoundError: No module named 'edc-reference' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'inte-reference'
ModuleNotFoundError: No module named 'inte-reference'  Hi, My... named 'inte-reference' How to remove the ModuleNotFoundError: No module named 'inte-reference' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'json_reference'
ModuleNotFoundError: No module named 'json_reference'  Hi, My... named 'json_reference' How to remove the ModuleNotFoundError: No module named 'json_reference' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'meta-reference'
ModuleNotFoundError: No module named 'meta-reference'  Hi, My... named 'meta-reference' How to remove the ModuleNotFoundError: No module named 'meta-reference' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'model-reference'
ModuleNotFoundError: No module named 'model-reference'  Hi, My... named 'model-reference' How to remove the ModuleNotFoundError: No module named 'model-reference' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'model-reference'
ModuleNotFoundError: No module named 'model-reference'  Hi, My... named 'model-reference' How to remove the ModuleNotFoundError: No module named 'model-reference' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'php-reference'
ModuleNotFoundError: No module named 'php-reference'  Hi, My... 'php-reference' How to remove the ModuleNotFoundError: No module named 'php-reference' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'reference-handler'
ModuleNotFoundError: No module named 'reference-handler'  Hi, My... named 'reference-handler' How to remove the ModuleNotFoundError: No module named 'reference-handler' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'reference_counter'
ModuleNotFoundError: No module named 'reference_counter'  Hi, My... named 'reference_counter' How to remove the ModuleNotFoundError: No module named 'reference_counter' error? Thanks   Hi, In your

Ads