Error: Not a Statement

Page 1 of 1

3 Replies - 232 Views - Last Post: 23 January 2012 - 09:48 AM

Topic Sponsor:

#1 Valous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 22-January 12

Error: Not a Statement

Posted 22 January 2012 - 02:30 PM

My Program when compiled has the errors at every line that has a statement using the "sbf append" method says that its not a statement. I don't know how to fix this. I tried doing what the compiler asked and all it wants me to do is get rid of the text statement after the append.

public class StringBuffer
{
	public static void main(String[] args)
	{
		StringBuffer sbf = new StringBuffer();
		sbf append; ("Hello");
		sbf append; (", my name");
		sbf append; (" How are you?");
		System.out.println(sbf);
		
		sbf.insert; (14," is Dalton.");
		System.out.println(sbf);

		sbf append; ("Can you");
		sbf append; (" spell");
		sbf append; (" racecar backwards?");
		sbf append; (" I can");

		Sbf reverse;
		
		System.out.println("racecar : ");
		System.out.println(sbf);
	}
}


Is This A Good Question/Topic? 0
  • +

Replies To: Error: Not a Statement

#2 thrca  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 28
  • View blog
  • Posts: 65
  • Joined: 21-January 12

Re: Error: Not a Statement

Posted 22 January 2012 - 02:39 PM

Just so you know, this looks like Java and not Javascript. Us JS guys might not be all that helpful here.
Was This Post Helpful? 1
  • +
  • -

#3 Valous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 22-January 12

Re: Error: Not a Statement

Posted 22 January 2012 - 02:43 PM

View Postthrca, on 22 January 2012 - 02:39 PM, said:

Just so you know, this looks like Java and not Javascript. Us JS guys might not be all that helpful here.

ok I'll move myslef elses where. Thank you though
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is online

  • No Sugar Coding Here!
  • member icon

Reputation: 4684
  • View blog
  • Posts: 20,362
  • Joined: 23-August 08

Re: Error: Not a Statement

Posted 23 January 2012 - 09:48 AM

Topic closed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1