SCJP, SCWCD, SCJD
yoland carls wrote:I'm not clear with Map, HashMap, HashTable, ArrayList, List, etc
yoland carls wrote:
Map<Integer>, ArrayList<Integer> intMap = new Hashtable<Integer>, ArrayList<Integer>();
is not working either.
yoland carls wrote:
I JUST WANT TO CHANGE THE " private static int[] intArray = {15,5,10,20,25,30}; "
TO USER INPUT. SO I CAN ENTER THE NUMBERS 20, 15, ETC. IN THE CONSOLE.
THIS IS NOT WORKING NOR OTHER THINGS I TRIED:
yoland carls wrote:I want to enter numbers and then for numbers summing 35, I would like to display:
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
yoland carls wrote:I am sorry for the confusion. But I just want to enter numbers, then display the pairs that will add up to 35. So I have the code working for displaying the pairs. I just cannot figure out how to make the user input scanner work. The Map is to display the pairs that add to 35. I appreciate your patience. Thanks
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
yoland carls wrote:This is the program to enter the numbers with the scanner:
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
yoland carls wrote:So, when I add the code to display the pairs that add to 35 as below:
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
yoland carls wrote:Sorry, here it is:
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
yoland carls wrote:Yes, it displays:
Enter a Number
9
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |