0

Multiply of string with integer in Java like Python

Hello I am new to java . How to multiply a string with integer in java like in Python. Eg 1: print("Hello"*3) output: HelloHelloHello How to do this in java with out using for loop in java.

16th Oct 2020, 4:49 PM
Varshith
Varshith - avatar
6 Antworten
+ 5
Java "Hello".repeat(3)
16th Oct 2020, 7:08 PM
Sumit Programmer😎😎
Sumit Programmer😎😎 - avatar
16th Oct 2020, 7:03 PM
Avinesh
Avinesh - avatar
+ 3
Sumit Programmer😎😎 that was too easy. I don't know how I missed that, there are a lot of methods to remember and I keep forgetting them.
16th Oct 2020, 7:12 PM
Avinesh
Avinesh - avatar
+ 2
Avinesh yah its too easy and i accidently remember that method
16th Oct 2020, 7:15 PM
Sumit Programmer😎😎
Sumit Programmer😎😎 - avatar
+ 1
Is there any possibility to do this without using for loop
16th Oct 2020, 5:01 PM
Varshith
Varshith - avatar
0
U can use for loop
16th Oct 2020, 5:00 PM
Ananiya Jemberu
Ananiya Jemberu - avatar