I am trying to upload file using POSTMAN REST client. i have configured Content-Type=multipart/form-data;boundary=---------------------------sdjkahdj294919323195 and file=<file.txt>
is that, line1 creates one object in heap ("abc") and in line 2, "def" goes to string constant pool and sb (line 1 's object) value gets modified. so total 2 objects. line 3 does not have any effect.
Arent these string literal also objects ? then how 3 objects gets created, it should be only one right. if it is 3 objects, then whats the difference between string and stringbuffer !!! ?
Ok. Thats fine. But my question is , compiler sees that test method return type is "int". But there is no "return" statement gets called here. So Why compiler doesn't say like "return statement is missing" ?
System.exit(0) makes control to return without executing finally block (Which is having return statement). So now there is no return value, why doesn't compiler throws an error ?
-- Tell me if my assumptions are correct or wrong , which i mentioned in comments ?
-- how different it is when overloading var-agrs (int... i) and (float... f) from (int i) and (float f). ?
My question is - What exactly Object 'a' will be containing internally? why a.f() executes 'class B' s method and why 'a.sub()' gives an error ? In short what is the internal structure of object 'a' in this case ?