Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #33407

Re: How to write constructor for an abstarct class?

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: How to write constructor for an abstarct class?
Date 2015-12-28 14:29 -0500
Organization A noiseless patient Spider
Message-ID <n5s2dd$igi$1@dont-email.me> (permalink)
References (1 earlier) <n5rcra$teb$1@dont-email.me> <n5ruh8$478$1@news.albasani.net> <n5rur8$4p1$1@news.albasani.net> <n5rv13$4vh$1@news.albasani.net> <96fe5a20-3ea4-4578-89c7-4f7e324fcfd0@googlegroups.com>

Show all headers | View raw


On 12/28/2015 1:42 PM, Eric Douglas wrote:
> On Monday, December 28, 2015 at 1:29:01 PM UTC-5, Jan Burse wrote:
>> Jan Burse schrieb:
>>> I get the following error:
>>> Error: java: Shape is not abstract and does not override abstract method
>>> getPerimeter() in Shape
>>
>> The IDE, for example IntelliJ, shows better errors.
>>
>> Hover over the class:
>>       Class 'Shape' must either be declared abstract or implement
>>       abstract method 'getArea()' in Shape.
>>
>> Hover over the abstract member:
>>       Abstract method in non-abstract class.
>>
>> Bye
>
> I thought Eric S' answer was clear enough.  The class compiles fine, just needs keyword abstract in front of keyword class.
> The real question is why would you want an abstract Shape?  java.awt has a Shape, which is an interface.

     The O.P. says it was written "to test abstract class."  I imagine
this means that he or she is new to Java, and is trying things out
to learn how they work (and has, indeed, learned something).  If I'm
right, the Shape class as posted is a learning exercise rather than a
"serious" program.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to write constructor for an abstarct class? Xue Feng <xf.lotus@yahoo.com> - 2015-12-28 20:44 +0800
  Re: How to write constructor for an abstarct class? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-28 08:21 -0500
    Re: How to write constructor for an abstarct class? Jan Burse <janburse@fastmail.fm> - 2015-12-28 19:20 +0100
      Re: How to write constructor for an abstarct class? Jan Burse <janburse@fastmail.fm> - 2015-12-28 19:25 +0100
        Re: How to write constructor for an abstarct class? Jan Burse <janburse@fastmail.fm> - 2015-12-28 19:28 +0100
          Re: How to write constructor for an abstarct class? Lew <lewbloch@gmail.com> - 2015-12-28 10:40 -0800
          Re: How to write constructor for an abstarct class? Eric Douglas <e.d.programmer@gmail.com> - 2015-12-28 10:42 -0800
            Re: How to write constructor for an abstarct class? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-28 14:29 -0500
            Re: How to write constructor for an abstarct class? j4n bur53 <janburse@fastmail.fm> - 2015-12-28 22:26 +0100
              Re: How to write constructor for an abstarct class? Eric Douglas <e.d.programmer@gmail.com> - 2015-12-28 13:37 -0800
              Re: How to write constructor for an abstarct class? j4n bur53 <janburse@fastmail.fm> - 2015-12-28 22:47 +0100
                Re: How to write constructor for an abstarct class? Eric Douglas <e.d.programmer@gmail.com> - 2015-12-28 13:58 -0800
                Re: How to write constructor for an abstarct class? j4n bur53 <janburse@fastmail.fm> - 2015-12-28 23:06 +0100
                Re: How to write constructor for an abstarct class? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-28 17:43 -0500
                Re: How to write constructor for an abstarct class? Lew <lewbloch@gmail.com> - 2015-12-28 15:14 -0800
                Re: How to write constructor for an abstarct class? j4n bur53 <janburse@fastmail.fm> - 2015-12-29 15:02 +0100
                Re: How to write constructor for an abstarct class? Arne Vajhøj <arne@vajhoej.dk> - 2015-12-29 15:37 -0500
                Re: How to write constructor for an abstarct class? Arne Vajhøj <arne@vajhoej.dk> - 2015-12-29 15:28 -0500
            Re: How to write constructor for an abstarct class? Arne Vajhøj <arne@vajhoej.dk> - 2015-12-29 15:21 -0500
              Re: How to write constructor for an abstarct class? Arne Vajhøj <arne@vajhoej.dk> - 2015-12-29 15:22 -0500
  Re: How to write constructor for an abstarct class? j4n bur53 <janburse@fastmail.fm> - 2015-12-29 16:24 +0100

csiph-web