ProblemSet... ProblemSet D Algorithms 1... ProblemSet. ProblemSet.. 0Proble Algo
ID: 3699788 • Letter: P
Question
ProblemSet... ProblemSet D Algorithms 1... ProblemSet. ProblemSet.. 0Proble Algorithms1... 18 19 20 q2: Write a public static method named q2 that takes no parameters and returns a new * ArrayList of type Double containing the values 5.31, 0.69, 4.09, and -4.42. The order of * these values must be maintained 23 25 26 27 public static void q20 a28 for( int i- 0; icarray . length-1, i++) { System.out.print In(array[i]) 31 32 * q3: Write a public static method named q3 that takes no paraneters and returns a new " HashMap with keys of type String mapped to values of type Integer containing the key-value 38pairs ("hero":36, "blind":17, "awareness7:-16, Teixture":7) 40 public static HashMapcInteger, Integer q30 0 b42 HashMap map-new HashMap); map.put("hero",36); map put("blind",17): map.put(" awareness". -16) map.put ("mixture",7); return map; Problems sriavadoc Declaration No consoles to display at this time.Explanation / Answer
Given below is the completed code for the question.
To indent code in eclipse , select code by pressing ctrl+a and then indent using ctrl+i
Please do rate the answer if it was helpful. Thank you
public static ArrayList<Double> q2()
{
ArrayList<Double> list= new ArrayList<Double>();
list.add(5.31);
list.add(-0.69);
list.add(4.09);
list.add(-4.42);
return list;
}
public static HashMap<String, Integer> q3()
{
HashMap<String, Integer> map = new HashMap<String,Integer>();
map.put("hero", 36);
map.put("blind", 17);
map.put("awareness", -16);
map.put("mixture", 7);
return map;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.