Question: 2. [6 points] Using the following class on the previous page (and also given below). and the Main class given below, what will the output
2. [6 points] Using the following class on the previous page (and also given below). and the Main class given below, what will the output be when it is executed? (Put the output in the output box) public elass Maitn public static void nsin(Stringll args) 03 onenew 03D 3 twonew 03("xys15) System.out.println("One:+one.getLetters(1one.getAO+one.getb0 System.out-println("o:Ewo.getLetters(1tWO getatwo.getBo) System.out printin("Thing One: one.thing (20)) System.out.print in("Thing Two:" two.thing (20)1 a int ans thing(4, 5) System.out printin(ans) i stuff (two) : system.out.printin("One:+ one.getLetterst)one.getat) one.getB)) 3ystem.out.println("Two: two.getLetters) tuo.getAOtwo.getBo) public static int thing (int a, int b publie elass 93 return (a +ba) private String letters private int az private int bi public static void stuff (03 thing) thing.setLetters("Imt") thing.setA(18) public 93( letters "abe" a = 7; public 03 (string word, int num) letters vord: a nu b num public void setletters (String thing) letters- thing public void setA(int value) a-value: public int getAO return ai public int getBo return b: public string getLetters ) return letters; public string thing (int a) return letters + this.a+a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
