CJCoding With Joseph
15free / daySign inCreate account

Laptop extends Device. The fields brand and price are private in Device, and the only way to fill them is the Device constructor. A subclass constructor reaches it with super(...), which must be its first statement. Complete the Laptop constructor.

Requirements: 1. Send brand and price up to the parent constructor. The starter calls super with placeholder values so that the file compiles: replace them. 2. Store ramGb in the field that Laptop adds.

The Device class is provided. Do not change it.

Do NOT write a main method.

Expected output

Lenovo
899.5
16

= newline. The output ends with a newline, so print one after the last line.

Hints3 available
Topics
InheritanceClasses
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)

Your output

Run your code to see the output here...

Test cases

Run your code to see test case results.