Search:

Type: Posts; User: helloworld922

Search: Search took 0.08 seconds.

  1. Re: Abstract methods. What are they for? And when it's necessary to use them?

    There could be certain things which all shapes inherit, for example the location and color of the shape. In that case you have to use an abstract class because there would be object members defined...
  2. Re: Abstract methods. What are they for? And when it's necessary to use them?

    Yes, but it involves using the Java Reflection API.

    There are 2 problems with using the Reflection API:
    1. You will have very little compile-time warnings and errors that something is wrong.
    2....
  3. Re: Abstract methods. What are they for? And when it's necessary to use them?

    Take this example:

    You have a base class called shape. Let's say this class is used to compute the area of multiple different subclasses of shapes. How would you even begin to compute the area of...
Results 1 to 3 of 3