Results 1 to 2 of 2
  1. #1
    zaper is offline Member
    Join Date
    Apr 2013
    Rep Power

    Unhappy [Java]Simple Mistake

    I'm having codes

    package Zjazd3;

    Java Code:
    public class main {
    	  public static void main(String[] args) {
    		    Appender ap = new Appender("Ala");
    		    ap.append(" ma kota", 3).append( " i psa", 2);
    		    ap.append(" ojej", 3);
    Java Code:
    package Zjazd3;
    import java.lang.IllegalArgumentException;
    public class Appender {
    	String napis;
    	public Appender(){		
    		napis = "";	
    	public Appender(String s){
    		napis = s;
    	 Appender append(String app, int n){
    		String s1 = app;
    		for(int i=0; i<n; i++){
                      napis = napis + s1;
    			  catch (Exception e) {
                    throw new IllegalArgumentException();
    		return new Appender (napis);
    When I run the program I see an error


    Help Please

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Rep Power

    Default Re: [Java]Simple Mistake

    That is no error. Appender doesn't override toString(). What you see id the current String representation of the Appender objects.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

Similar Threads

  1. Factorial - java.lang.stackoverflow? Where's the mistake?
    By SwordMaster in forum New To Java
    Replies: 3
    Last Post: 12-03-2012, 07:05 PM
  2. Hello, I got a mistake
    By F1ke in forum New To Java
    Replies: 7
    Last Post: 09-25-2011, 08:11 PM
  3. Point my mistake
    By amzers in forum New To Java
    Replies: 11
    Last Post: 12-16-2010, 01:31 PM
  4. i can't see the mistake
    By PVL268 in forum New To Java
    Replies: 3
    Last Post: 04-29-2009, 05:26 AM
  5. i can't see the mistake
    By PVL268 in forum New To Java
    Replies: 2
    Last Post: 04-28-2009, 06:30 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts