Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

help 4 abstract class

Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi to all,
i have just faced a problem, which i think can be solved here !
i have written following code in
// start of code

abstract class stat1
abstract public void method();
abstract class stat2 extends stat1
int f = 20; // these 2 lines says error
public class stat
int a = 10;
static int b = 20;
public static void main (String args[])
int c = args.length;
stat d = new stat();
// end of code
when i am compling it it is giving 2 errors
at line 10
<identifer> expected and
cannot resolve symbol System.out.println
please copy the code and try out at u r system.
thanks in advance
sachin kumar
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you get a compile time error because the statement
must either be
1. within a method declaration as in
public void display()
2. it must be within a static initializer block as in
hope that helps
harder u try luckier u get
It was the best of times. It was the worst of times. It was a tiny ad.
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic