Description of this paper

CMIS 242 Intermediate Programming homework 1




nstructions;Indicate whether each of the following statements is true or false;Local variables always retain their values from one call of a method to the next.;There is only one copy of each class variable that is shared by all instances of the class.;The reserved word this can be used in class methods.;Private instance variables can accessed in any instance method in the same class.;Public methods can be can be accessed by any method in the same program.;What is the output of the following program? Explain. public class Test;public static void main(String[] args);int i = 1;StringBuilder s = new StringBuilder("s");String t = "t;someMethod(i, s, t);System.out.println("i = " + i);System.out.println("s = " + s);System.out.println("t = " + t);private static void someMethod(int i, StringBuilder s;String t);i++;s.append("s");t += "t;Is the following class immutable? Explain class Class1;private int[] array = new int[10];public int[] getArray();return array;Will the following class compile? class Class2;private void method();public static void main(String[] args);method();If not, explain why and correct it so it will compile.;Explain the meaning of the reserved word this and why it is necessary in the class below. Will the class compile without using this? class Class3;private int x;public Class3(int x);this.x = x


Paper#67644 | Written in 18-Jul-2015

Price : $22