Hello, can someone please help me out with this code ? import java.lang.String;

/ Life is not fair Write a program that displays 9 times: «Life is not fair - get used to it.». / public class Solution { public static void main(String[] args) { //add your code here }

public static void print3Times(String s)
{
    System.out.println(s);
    System.out.println(s);
    System.out.println(s);
}

} I have no idea how to do it, I tried everything i know, but no luck :/

asked 05 Sep '15, 08:26

N991's gravatar image

N991
11
accept rate: 0%


In main method call the function print3Times("Life is not fair - get used to it.") 3 times.

link

answered 14 Nov '15, 02:51

Alina%20Munir's gravatar image

Alina Munir
113
accept rate: 0%

How do I call the print function 3 times? What do I type specifically?

link

answered 30 Jul '16, 17:24

erin's gravatar image

erin
111
accept rate: 0%

You call the function print3Times 3 times in the main function!

public static void main(String[] args){
String s = "Life is not fair - get used to it.";
print3Times(s);
print3Times(s);
print3Times(s);
}
link

answered 01 Aug '16, 01:56

Alina%20Munir's gravatar image

Alina Munir
113
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×53
×31
×7

Asked: 05 Sep '15, 08:26

Seen: 2,064 times

Last updated: 01 Aug '16, 01:56