Question: IN JAVA PLEASE ASAP MULTIPLE CHOICE Question 6 (10 points) Will the following code compile? Java C# abstract class A private int x; public AOC
IN JAVA PLEASE ASAP MULTIPLE CHOICE



Question 6 (10 points) Will the following code compile? Java C# abstract class A private int x; public AOC x=7; using System; abstract class A private int x; public AOC x=7; XEY: public Aint y){ } public abstract int do_stuff1(); public abstract int do stuff20); public Alint y) { x=y: } public abstract int do_stuff10; public abstract int do stuff20; class B extends A{ public B() { super(7); class B:A public B(): base(7) { public B(int y): base (y) { public Blinty) superlyl: } @Override public int do_stuff10 return 4; @Override public int do_stuff20 return 4; public override int do_stuff1() { return 4; } public override int do_stuff20) { return 4: class MainClass. public static void Main(stringll args) B myB = new B(5): class Main public static void main(String[] args) { B myB = new B(5); No, class A cannot have a constructor since it's abstract. No, class B can't have a constructor since it's inheriting from an abstract class A. No, you can't use super/base to call a constructor in an abstract class. Yes Question 7 (10 points) Will the following code compile? Java C# using System; interface IA public void do_stuff10: 1 interface 1B public void do_stuff20: interface IAL void do_stuff10; } interface IBU void do_stuff20); 3 class C:IA,IB public void do_stuff1() { int a=1 } public void do_stuff20) { int b=1; class C implements IA IB @Override public void do_stuff1() { int a 1: @Override public void do_stuff20 { int b=1; class Main public static void main(String[] args) { C myC = new C(): class MainClass! public static void Main (stringl] args C myC=new CO: No, class C is not allowed to implement IA and IB. No, you can't instantiate an object of type C. No, methods in an interface can't have a void return type. Yes Question 9 (10 points) Will the following code compile? Java C# interface IA public void do_stuff1(); using System; interface IAL void do_stuff10); abstract class B public abstract void do_stuff20; abstract class B public abstract void do_stuff20); class C extends B implements IA @Override public void do_stuff10) { int a=1; class C:BIA public void do_stuff10 int a=1; 3 public override void do_stuff20 / int b=1; @Override public void do_stuff20){ int b=1; class MainClass, public static void Main(string[] args C myC=new CC: class Main public static void main(String[] args) { C myC = new CC: No, Class C can't extend one class (B) and implement an interface (1A), it can only do one or the other. No, Class C doesn't correctly override do_stuff20) No, class C cannot be instantiated because it implements an interface. Yes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
