Hitman Absolution Highly Compressed 10mb – 19
Category:Video on demand
Category:Digital distributionQ:
Is it possible to call two classes from different locations?
I have the following classes in my project
class Abc
{
}
class Xyz
{
}
I want to call the methods of the Abc class from Xyz class. Is it possible?
I am trying this way but it gives me an error.
Abc a=new Abc();
Xyz x=new Xyz();
x.Abc(a); //giving error
A:
A Class cannot be instantiated directly. You should either create objects of it or create an object of an derived class.
A class is also not meant to be abstract, so it makes no sense to use it as a base class for other classes, especially not for something as simple as a plain pointer.
This is only possible if the two classes were somehow related. The simplest way is if they were in the same project, in the same namespace and in the same class hierarchy.
If you can't use that though, you can create a simple interface, having a single method and a single implementation. Then you can create objects of the classes implementing that interface.
class IAbc {
public void DoSomething() {
//Do something
}
}
class Abc: IAbc {
//Implementation
}
class Xyz: IAbc {
//Implementation
}
abstract class BaseClass {
abstract void DoSomething();
}
abstract class DerivedClass: BaseClass {
//Implementation
}
class Implementation {
public void DoSomething() {
//Do something
}
}
Xyz xyz = new Xyz();
Implementation implementation = xyz.DoSomething();
Abc a = new Abc();
Implementation imp = a.DoSomething();
Reduced expression of the neuronal calcium sensor-1 in epileptic humans.
Mutations of the neuronal calcium sensor-1 gene (CASQ1) are known to cause a dominantly inherited form of early-onset epileptic encephalopathy be359ba680
Related links:
Comments