Skip to content
Advertisement

Tag: integer

How can I convert arraylist to arraylist

My goal is to find on which specific index is String from ArrayList and add them to new ArrayList, So if house is [0] than i want to return new ArrayList with integer. At the begging I have ArrayList like this Input : And I want to get new ArrayList like this Output: Answer You can do it just by

Remove numbers from a list that begins with a specif digit

For example, i have this list How i remove only the numbers that begins with “6” Answer There are several ways how you can approach this task: using an Iterator; by utilizing so-called traditional for loop; with a help of Stream IPA; using method Collection.removeIf(). Note that attempt to address this problem using enhanced for loop (sometimes called “for-each” loop)

Calculate percent [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I was wondering how to calculate the percentage in a level system, let me explain better: The user has his experience and this represents the level

Casting a string to an integer and then to a double – how to retrieve up to four positions behind the decimal position in a correct way?

I am currently working on a simple BMI (Body Mass Index) calculator in Java, in a larger Java / Spring Boot application with Mojito Tests. My function uses height and weight as Input values to calculate the BMI. Through the arithmetic operations, the received Input values – Strings, casted to Integers – result in a number that represents the BMI;

How to find max number and occurrences

So I’m learn java for the first time and can’t seem to figure how to set up a while loop properly . my assignment is Write a program that reads integers, finds the largest of them, and counts its occurrences. But I have 2 problems and some handicaps. I’m not allowed to use an array or list because we haven’t

Advertisement