Java SE 8 Programmer I (1Z0–808) Important Questions 101 Day 3

I love learning about technology and sharing that with others
Hi All, I won’t be wasting your time so today’s question is first to think on your own what can be the possible output of the following program then if you are not able to solve or need proper explanation scroll down.
The output of the above program is
Output
int
string
Explanation:
First of all here we have four methods with the same name but the arguments or parameters of all the function is different so clearly we can see there is overloading of function is going on.
- On line number 21 char is assigned a value 10 and that is legal since the character can store unsigned value up to 1 byte
2. so when the character is passed to a function enroll it will be acting as an integer and this integer is a legal argument for both long and int so which enroll function it should be choosing it will choose the int one because the char value will be expanded to its nearest type.
3. When the string is passed it be either goes to String or Object since both share the base and derived class relation it is legal to define two overloaded methods with this type of arguments but the function that will be called which is more specific and String is more specific than Object.
Learning, Unlearning, and Repeating.
Hi Everyone I am a Software Developer in one of the big tech companies. While I am preparing for the OCA 1Z0–808 this certification is for the java 8 and for the associate level after that we have one for the professional level. Coming back to the thing why I am writing this series of blog posts because these are some of the most important questions and difficult topics that I have faced while I was preparing for the exam. It will be easier for you to just read the full explanation for the questions and understanding the topics. :)

