Explain what will happen in the following code segment: public class Wrap { //be
ID: 3608555 • Letter: E
Question
Explain what will happen in the following code segment: public class Wrap { //begins wrap public static void main (String[ ] mark){ IntegermyInt = new Integer (2); System.out.println("myInt is " + myInt); myInt =5; System.out.println("myInt is" + myInt); } //end main } //end Wrap Also: what Java 5.0 feature does this show? Explain what will happen in the following code segment: public class Wrap { //begins wrap public static void main (String[ ] mark){ IntegermyInt = new Integer (2); System.out.println("myInt is " + myInt); myInt =5; System.out.println("myInt is" + myInt); } //end main } //end Wrap Also: what Java 5.0 feature does this show?Explanation / Answer
output will be: myInt is 2 myInt is5 it show the features that int 5 is type casted to Integer class. We need not to type cast thevalues.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.