Project #122594 - Business Computer Languages

Q1. Write the syntax for • declaring an array holding 10 String values • declaring an ArrayList holding String values. [1 Points] Q2. Use a for loop to fill an Arraylist with the square of the numbers 1 to 10. The output should be ( 1, 4, 9, 16, ..100): [3 Points] Q3. Rewrite the following loops, using the "for each" construct. Here data is an array of double values. [1 point] for (int i = 0; i < data.length; i++) sum = sum + data[i]; Q4. Write preconditions for the following methods. Do not implement the methods. [3 point] a. public static double sqrt(double x) b. public static String romanNumeral(int n) c. public static String weekday(int day) Q4. Define class cohesion and class coupling. [1 Points] Q5. What is a static method ? What is a static variable ? Explain and provide examples. [2 Points] Q6. What is an Immutable Class ? [1 Point] Q7. Draw a memory diagram that shows why the following method can't swap two BankAccount objects. [3 point] public static void falseSwap(BankAccount a, BankAccount b) { BankAccount temp = a; a = b; b = temp; }

Subject Computer
Due By (Pacific Time) 04/24/2016 09:30 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy