please answer this question correctly asap. I need to submit this Take a look at
ID: 3599034 • Letter: P
Question
please answer this question correctly asap. I need to submit this
Take a look at code blow, what's wrong with the following code? Why?
namespace WebApplication1
{
public class c1
{
public static void test1() { }
public void test2() { }
private static void test3() { }
private void test4() { }
}
}
namespace WebApplication1
{
public class c2
{
public void test()
{
c1 t1 = new c1();
t1.test1();
c1.test1();
t1.test2();
c1.test2();
t1.test3();
c1.test3();
t1.test4();
c1.test4();
}
}
}
Explanation / Answer
namespace WebApplication1
{
public class c1
{
public static void test1() { }
public void test2() { }
private static void test3() { }
private void test4() { }
}
public class c2 : c1
{
public void test()
{
c1 t1 = new c1();
t1.test1();
c1.test1();
t1.test2();
c1.test2();
t1.test3();
c1.test3();
t1.test4();
c1.test4();
}
}
}
Corrections:
There is need of inheriting the above class so that the functions are been called upon and the definition of the function is been known to the class.The classes needs to be inherited and the functions are been tested depending on it.
Thankyou.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.