Question: This is Java Problem So in python for example I have a number of int 5 and a string T. and it will print :

This is Java Problem

So in python for example I have a number of int 5 and a string "T". and it will print : TTTTT

in Python it symply do number * string and got that result

However. How do i do in Java?

I use this method but it wold not work

int number = 5

String Tell = "T"

String Result = Tell. repeat (number)

it's comes out error

Error: cannot find symbol symbol: method repeat(int) location: variable stars of type java.lang.String

Is there any other way to get this same result?

I cant give you the whole code because it is my work and if i post it here somebody else can use it. But my problem is only like that above Thanks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!