Olakunle Oladipo Oni wrote:(1) I wrote a java program involving the use of the FileInputStream class to read from a plain text and executable file. As expected, being a byte stream, the
generated result was a series of integers representing the individual bytes read from the stream. The sample results look like this:
49 43 182 0 23 54 4 178 0 20 187 0 11 89 21 4 184 0 26 183 0 16 18
......................and so on. The integers spans rows. I use my program to determine the byte count. Of course i know if I'm to read the plain text file and
view it as it really is i.e. see the text in the result i should use a FileReader character stream. My concern for this question is not character streams. I'm
interested in knowing how the individual bytes got resolved into integers of varying ranges. I'm aware that byte data type have a range of 0-255 for unsigned
integers and that's why non of the output integers exceed that range safe for the -1 integer value that marks the end of the file. Most interestingly, the numbers
of the integers exceeds the number of words making up the plain text. How did the integers of varying ranges came to be? Are the individual integers a result of
each individual character of the text. Is there a provision for the spacing between the words that make up the text. What are the zeros in the outcome
representing? I'll appreciate a clear explanation.
.
Olakunle Oladipo Oni wrote:
(2) One of the established rules of implementing proper object formation via inheritance is to make a call to the superclass constructor the first statement
after defining the subclass constructor. Something i want to get clearly is that, if the superclass portion of my subclass object get initialized via call to
super(a,b); does this actually translate to the automatic initialization for this instance variables for the subclass portion of the code even if this variable
have private access in the superclass? If the subclass constructor is used as a means of initializing the superclass portion of the code, is the subclass
constructor actually initializing itself with these values as well since it has access to the variables by inheritance? Is it typical that the superclass and subclass
constructors can intitialize themselves differently (with different values) for the same kinds of attributes(variables)? I'll appreciate a clear answer to this
question putting into consideration the access level from the superclass.
.
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
|