PROG24178 Study Guide - Quiz Guide: Global Variable, Subtyping, Local Variable

261 views2 pages

Document Summary

An abstract class is a class that contains abstract methods. They cannot be instantiated, but they can be subclassed. Meaning you cannot call an instance of the abstract class, but you can create subclasses from an abstract class. Any class that has abstract methods has to be called an abstract class. Abstract classes look a lot like interfaces, but they have something more : you can define a behavior for them. Data shadowing in java is when a variable is shadowed if there is another variable with the same name that is closer in scope. If there is a local variable with the same name as a global one, the local variable takes precedence. If a variable in scope has the exact same name as one in a larger scope, then the one in the smaller scope takes precedence. Demo. java class demo int i=10; void show(int i)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents

Related Questions