Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can you help me with the page 3 questions(IS THAT STATMENTS ARE VALID OR INVALID

ID: 3861901 • Letter: C

Question

Can you help me with the page 3 questions(IS THAT STATMENTS ARE VALID OR INVALID(IF THAT INVALID EXPLAIN WHY)?

NAME CSC 162 HW 12 inheritance (lecs, 7-8) se that we have the followi class definitions. public class superclass protected int x: private String str; public void print() System out.println(x str): public SuperClass public SuperClass(String si int a str public class SubClass extends SuperClass private int y: public void print() System.out println("SubClass: y); super, print(): public SubClass() super(): public SubClass(String s, int a, int b) super("Hello Super", a b);

Explanation / Answer

      mycar1 = new car(); invalid. there is no class named car.

mycar2 = new car("ford",1200,"green"); invalid. there is no class named car.

myelec1 = new electriccar (); valid.

myelec2 = new electriccar(15) = invalid. electriccar int has private access in electriccar method.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote