• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

u cannot subclass the array class?

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You cannot subclass the array class?
Can some one explain me with example
thanks,
kittu
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by kittu anu:
You cannot subclass the array class?
Can some one explain me with example
thanks,
kittu


If you take a look at the Java API, you can find the javadocs for the Array Class. One of the first lines looks like this:

public final class Array


Notice the word final, which I bolded. Because Array is declared final, you can not subclass it, as that's what the final modifier means when used with a class.
I hope that makes sense,
Corey
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you write sth like this :

Actually it's amazing because when I tested this code, I got this:

With the J2SE 1.4 beta 2 you get however:

which is what we expected...
So no you can't subclass an array.
HIH
[ January 31, 2002: Message edited by: Valentin Crettaz ]
 
kittu anu
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Corey and val,
every time i used to read this sentence and when i go for revision again it seems to be new to me.now seeing val's example and Corey statement i can remember for every.Thanks again.
 
reply
    Bookmark Topic Watch Topic
  • New Topic