Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Write a method to display the sum of two input integers in reverse order: pub

ID: 3625878 • Letter: 1

Question

1. Write a method to display the sum of two input integers in
reverse order:

public static void reverse(int inputNumber1, int inputNumber2)


2. Write a method that takes an array of strings and
returns an array of integers representing the length of each each
at that index:

public static int[] countLengths(String[] inputStrings)

For example if inputStrings[0] = "cmis242" then if the
returned int[] is named stringLengths, then stringLengths[0] = 7



3. Explain what is meant by the following and how
they relate to each other:

a. private

b. protected

c. public


4. What is the difference between an instance method
and a static method? When you decided to use one versus the other?

5. Is the following valid, and why:

Integer i = Max.max(7, 9);

6. Explain the significance of the following:

a. public final class Halloween

b. public abstract class Halloween

c. The finalize method

d. private final int age = 9;

Explanation / Answer

You should ideally post these separately instead of all 6 in one, so I'll answer 3 now.

1.

public static void reverse(int inputNumber1, int inputNumber2)
   {
        int sum=inputNumber1+inputNumber2;
        String s=Integer.toString(sum);
       
        for(int x=s.length()-1;x>=0;x--)
           System.out.print(s.charAt(x));
   }

 

2.

public static int[] countLengths(String[] inputStrings)
   {
       int[] stringLengths=new int[inputStrings.length];
      
       for(int x=0;x          stringLengths[x]=inputStrings[x].length();
         
          return stringLengths;
        }

 

3.

Here's a link to an answered question which contains what you need. Full credit to the author.

http://javapapers.com/core-java/access-modifiers-in-java-explain/

 

Post the rest of the questions seperately and I'll glady answer them !