aspose file tools
The moose likes Beginning Java and the fly likes [solved]warning message: Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "[solved]warning message:" Accessing static method numbers" #7th floor" Watch "[solved]warning message:" Accessing static method numbers" #7th floor" New topic
Author

[solved]warning message:" Accessing static method numbers" #7th floor

L Willie
Ranch Hand

Joined: Aug 10, 2008
Posts: 51
[solved]no idea,may somebody give me some hints for the question?

Write a method to display a pattern as follows:

1
2 1
3 2 1
...
N n-1 3 2 1

The method header is
public static void displayPattern(int n) //Assumption: n <= 99

harilal ithikkat
Ranch Hand

Joined: Oct 06, 2008
Posts: 221



OUTPUT
1

2 1

3 2 1

4 3 2 1

5 4 3 2 1

6 5 4 3 2 1

7 6 5 4 3 2 1

8 7 6 5 4 3 2 1

9 8 7 6 5 4 3 2 1

10 9 8 7 6 5 4 3 2 1




SCJP 1.5
"A candle looses nothing by lighting another candle"
itechmentors.com
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
harilal ithikkat wrote:

impressive job of doing someone else's homework. good show.
L Willie
Ranch Hand

Joined: Aug 10, 2008
Posts: 51
pete stein wrote:
harilal ithikkat wrote:

impressive job of doing someone else's homework. good show.

thank a lot
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56228
    
  13

harilal ithikkat, please read this.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
L Willie
Ranch Hand

Joined: Aug 10, 2008
Posts: 51
Bear Bibeault wrote:harilal ithikkat, please read this.

is ok,i'll learn and understand from the answer,not only copy and submit homework.
L Willie
Ranch Hand

Joined: Aug 10, 2008
Posts: 51


after i modified bit from the answer given by harilal ithikkat .
it can compile and run properly.
However,compiler promt warning message "Accessing static method numbers" on myAnswer.numbers();[line22]
What the warning message state about?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32712
    
    4
You're lucky Bear found this thread before I did. I would simply have deleted the solution.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32712
    
    4
Static methods should be preceded by the name of the class, not the name of the object. If they are in the same class, you simply write the name of the method.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: [solved]warning message:" Accessing static method numbers" #7th floor
 
Similar Threads
David Smalley
Multithreading: How can total be nearly 5,000 even though loop is up to 100?
Using Postfix notation......
n++
A So Strange question !!(scjp07-Q108)