Java Constructor Supercomputer Options

Looking at the code of the abstract class ByteBuffer , it inherits it from the base class Buffer .

ByteBuffer has one constructor:

 ByteBuffer(int capacity) { super(capacity); } 

And Buffer has one constructor:

 Buffer(int mark, int pos, int lim, int cap) { ... } 

So, my question is: when ByteBuffer calls its parent constructor, how it works, because the parameters are not the same?

UPDATE. This is not a question, but it is worth knowing that some online Java source repositories (docjar in this case) contain the mish-mash of the Java source. Best Download JDK **

+4
source share
2 answers

Sounds like a documentation error.

The ByteBuffer source on GrepCode is eligible.

  ByteBuffer(int mark, int pos, int lim, int cap, // package-private 274 byte[] hb, int offset) 275 { 276 super(mark, pos, lim, cap); 277 this.hb = hb; 278 this.offset = offset; 279 } 280 
+4
source

I'm afraid it looks like the Buffer class you are looking at is deprecated - the current javadoc has:

 ByteBuffer(int mark, int pos, int lim, int cap) { // package-private ByteBuffer(int mark, int pos, int lim, int cap, // package-private byte[] hb, int offset) 
0
source

All Articles