Results 1 to 3 of 3
Thread: java
- 03-23-2012, 03:54 PM #1
Member
- Join Date
- Mar 2012
- Posts
- 2
- Rep Power
- 0
java
hi sir i am trying below program i getting error ie"
A.java:5: illegal start of expression
public static void nPrintln(String message, int n)
^
A.java:12: ';' expected
^.gif)
.gif)
2 errors"
please help me
class A
{
public static void main(String[] args)
{
public static void nPrintln(String message, int n)
{
n=5;
for (int i = 0; i < n; i++)
System.out.println(message);
}
}
}
- 03-23-2012, 03:55 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
Re: java
That's a method in the scope of another method body; you can't do that in Java.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 03-23-2012, 04:21 PM #3
Member
- Join Date
- Mar 2012
- Posts
- 2
- Rep Power
- 0


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks