English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Write the definition of a method printDottedLine , which has no parameters and doesn't return anything. The method prints to standard output a single line (terminated by a newline) consisting of five periods.

how do I write this?

2006-10-06 10:33:13 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

Iam actually confused with this:

The method prints to standard output a single line (terminated by a newline) consisting of five periods.

2006-10-06 10:42:59 · update #1

3 answers

This is such an easy question that it's hard to say anything without just giving you the answer, which I won't do.

So, find an example of a method in your notes or book. There's bound to be one just like what you describe, or a couple of examples that each demonstrate what you need.

Then find an example of how to print text. Change the text and put this line in your new method.

This is a very easy question, and I think you should try to answer it yourself.

2006-10-06 10:35:26 · answer #1 · answered by arbeit 4 · 0 0

I'm not sure what you're confused about, but a method that doesn't take any parameters no return anything (i.e., void) that does this would look exactly like:

void printDottedLine() {
System.out.println (".....");
}

Note that "println" will give you a single line with a linefeed, so you shouldn't need a "\n".

2006-10-06 20:21:00 · answer #2 · answered by Dr.Mr.Ed 5 · 1 0

If you are confused then tell us what is confusing you!!

It is almost as if you are saying you don't understand the word Java!!

Give us something to work with and we will help you to answer the question.

PS. Five periods terminated by a new line will look like this:
".....\n"

2006-10-06 18:19:57 · answer #3 · answered by AnalProgrammer 7 · 1 0

fedest.com, questions and answers