Re: very new to java
- From: "Andrew Thompson" <andrewthommo@xxxxxxxxx>
- Date: 25 Sep 2006 02:41:12 -0700
porky008 wrote:
i am very new as you can see. what am i doing wrong here. any help
would nice
The first suggestion I will make is that when you have a problem with
a nice little example of code, tell us exactly what the problem
is (for extra points, add what you expected to see).
At the moment, this code produces some compile time errors,
starting with..
D:\Welcome.java:6: illegal start of expression
System.out.printf( %s \n%s \n,
...to fix that error, you need to obey the method signature
for the printf method, e.g. printf(String, Object), so to fix it..
public class Welcome
{
// main method begins execution of Java application
public static void main( String args[] )
{
System.out.printf( %s \n%s \n,
// "quote" the string..
System.out.printf( "%s \n%s \n",
"Hi, my name is xxx.", "I was born in xxx.");
} // end method main
} // end class Welcome
HTH
Andrew T.
.
- References:
- very new to java
- From: porky008
- very new to java
- Prev by Date: Re: very new to java
- Next by Date: join java-soft-shadab
- Previous by thread: Re: very new to java
- Next by thread: join java-soft-shadab
- Index(es):
Relevant Pages
|
|