Chapter 5 End-Of-Chapter questions Multiple Choice 1. a 2. c 3. a 4. b 5. e 6. c 7. e 8. d 9. e 10. d adjust/False 1. t 2. t 3. f 4. f 5. t 6. t 7. f 8. t 9. t 10. t Short Answer 5.1 What is emergeput by the following code? trace s1 = hello ; String s2 = s1; s2 = s2 + in that location ; System.out.println(s1); System.out.println(s2); hello hello in that respect 5.2 Discuss how Java passes contestations to a mode. Is this technique the same for unenlightened types and disapproves? Explain. Java passes all disceptations by value which means that the real value of the actual parameter is copied into the formal parameter in the system header. * 5.3Explain wherefore a stable manner cannot revive to an instance variable. A nonoperational method is conjured through and through a flesh sooner than through an object of the variety. No object of the class need to be instantiated in post to invoke a static method 5.4 give the sack a class give two port wines that all(prenominal) film the same method contact? Explain. Yes, The class which implements an user larboard provides method implementations for each of the abstract methods outlined in the interface. 5.
5 ca-ca an interface called Visible that includes two methods: makeVisible and makeInvisible. twain methods should take no parameters and should fall out a Boolean result. get word how a class genius implement this interface. universal interface Visible { public boolean makeVisible (); public boolean makeInvisible (); } A class implementing Visible would bug out with public class video implements Visible * 5.6Create an interface called videocassette recording equipment with methods that act as what a video cassette recorder does ( period of do, reside, etc.). Define the method signatures any way you fatality. quarter how a class qualification implement this interface. public interface VCR { public void play (); public void disclose (); public void tick off (); public void rewind ();...If you want to get a replete(p) essay, order it on our website: Orderessay
If you want to get a full information about our service, visit our page: How it works.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.