Skip to content
Advertisement

Tag: multidimensional-array

Add more element to a 3×3 2D array

I’m writing an inventory list program, that provides the user with option of adding an item to the list of exiting the program. To add an item the user enters 1 and is promoted to enter the item details( item name, price and quantity of the items). The information enter by the user is entered into a 3×3 2D array

Get values by key from JSON Multi-dimensional Array

JSON: Code: Output: I’m only retrieving the first value How do I retrieve all name values from a nested JSON Array? Thanks in advance! Answer With your current implementation, you are getting JsonNode object and you are reading it’s name property, but you are not reading that property for it’s chlildren (inner objects). You have to query all nested objects

Solving a matrix equation in Java

I have been trying to implement the given formula in JAVA but i was unsuccessful. Can someone help me find what I am doing wrong? Do i need to shift the summation index and if so how? My code: Answer Just trying to collect all my comments under the question into one coherent answer, since there are quite a few

How to split string of mulitdimensional array

i have string here String str1 = “{{1,2,3},{4,5,6},{7,8,9}}” and the result i expect is like this what method i use in java language? Thanks. i tried with split method then put each array into an arraylist variable “data”. result : and try to delete the data array that is empty and which only has a string value”,” result : and

Advertisement