ToString method / errors

I am recieving an error for salaryAmt. Please help..
String result;
String firstNamelength = " ";
String lastNamelength = " ";
salaryAmtlength = " ";
NumberFormat fmt = NumberFormat.getCurrencyInstance();
result += lastName + "," + lastNamelength.substring(0,lastNamelength.length - lastName.length()) + firstName + firstNamelength.substring0,firstNamelength.length() - firstName.length()) + midInitial + "." + (salaryAmtlength.substring(0,salaryAmtlength.length - salaryAmt.length());
return result;

>
I am recieving an error for salaryAmt. Please help..
String result;
String firstNamelength = " ";
String lastNamelength = " ";
salaryAmtlength = " ";
has salaryAmtLength been declared ( as a String-type ) somewhere else in the program?

Similar Messages

  • No such method error

    Hi, I'm getting a message that reads: exception occured during event dispatching: java.lang.nosuchmethod error.
    Here's some of my code for a game of blackjack when I press the start game button everything works fine the textfield displays 2 cards and it gives me a total for the 2 cards.
    But when I press the hit button that's when I get the nosuchmethod error.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*; // added for event handling
    public class Blackjack_Frame
            final JFrame aFrame = new JFrame("MMSD 3610 Blackjack");
            Container contentPane = aFrame.getContentPane();
            aFrame.setSize(450, 200);
         // We don't need to set the layout manager for
         // a JFrame's content pane - it is automatically a
         // BorderLayout by default!
         // Technique for centering a frame on the screen.
         Dimension frameSize = aFrame.getSize();
         Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
         aFrame.setLocation((screenSize.width - frameSize.width)/2,
                     (screenSize.height - frameSize.height)/2);
         aFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         // Let's create the leftmost panel.  Note that we use names
         // for our components that are somewhat self-documenting.
         JPanel leftPanel = new JPanel();
         // We'll assign the panel a GridLayout (it would otherwise
         // default to FlowLayout).
         leftPanel.setLayout(new GridLayout(3, 1));
         // We'll create two labels on the fly and hand them
         // to the panel; there's no need to bother maintaining
         // a named handle on any of these labels.
         leftPanel.add(new JLabel("BLACKJACK ! :"));
         leftPanel.add(new JLabel("Your hand:"));
         leftPanel.add(new JLabel("Dealers hand:"));
         // Now, we'll attach the panel to the frame.
         contentPane.add(leftPanel, BorderLayout.WEST);
         // Repeat the process with the center panel.
         JPanel centerPanel = new JPanel();
         centerPanel.setLayout(new GridLayout(3, 1));
         // Here we make the TextField un-editable to the users
         // but it is enabled so we can display the cards
            // to the user.
           final JTextField input1TextField = new JTextField(30);
         input1TextField.setEditable(false);
         input1TextField.setEnabled(true);
         JTextField input2TextField = new JTextField(30);
         input2TextField.setEditable(false);
         input2TextField.setEnabled(true);
         JTextField input3TextField = new JTextField(30);
         input3TextField.setEditable(false);
         input3TextField.setEnabled(true);
         centerPanel.add(input1TextField);
         centerPanel.add(input2TextField);
         centerPanel.add(input3TextField);
         contentPane.add(centerPanel, BorderLayout.CENTER);
         // This panel displays all the buttons.
         JPanel buttonPanel = new JPanel();
         buttonPanel.setLayout(new GridLayout(1, 4));
         JButton hitButton = new JButton("HIT");
         JButton stayButton = new JButton("STAY");
         JButton endGameButton = new JButton("END GAME");
         JButton startGameButton = new JButton("START GAME");
         buttonPanel.add(hitButton);
         buttonPanel.add(stayButton);
         buttonPanel.add(endGameButton);
         buttonPanel.add(startGameButton);
         contentPane.add(buttonPanel, BorderLayout.SOUTH);
         // I tried using named inner classes first but didn't have much
         // luck so I had better success with anonymous inner classes.
         // First, we create a listener object to respond to
         // the "START GAME" button.
               ActionListener listen = new ActionListener()
           public void actionPerformed(ActionEvent e)
             CardDeck deck = new CardDeck();
                  deck.shuffle();
                  Hand myHand = deck.dealHand(2);
                  Hand yourHand = deck.dealHand(2);
                 input1TextField.setText(" " + (myHand) +
                     ("  Dealer's hand has " + myHand.getBlackjackHandValue()));
         };  // After doing some research I found I had to use this weird };
                // syntax because I needed to terminate the single statement
                // " ActionListener listen = new ActionListener() "
             // ... and then we register this listener with the appropriate
             // component.
             startGameButton.addActionListener(listen);     
         // We do the same for the "HIT" button.
         listen = new ActionListener()
              public void actionPerformed(ActionEvent e)
               CardDeck deck = new CardDeck();
               deck.shuffle();
               Hand myHand1 = deck.dealHand(1);
                  Card newCard = myHand1.getCard();
    // I seem to be getting the error right here.
                  Hand myHand = newCard.addCardBackInHand();
                  input1TextField.setText(" " + (myHand) +
                     ("  Dealer's hand has " + myHand.getBlackjackHandValue()));
              hitButton.addActionListener(listen);
         // We do the same for the "END GAME" button.
         listen = new ActionListener()
              public void actionPerformed(ActionEvent e)
               aFrame.dispose();
               System.exit(0);
              endGameButton.addActionListener(listen);
           aFrame.setVisible(true);
    // Class defining a hand of cards and we use the ever so helpful Stack to store the hand.
    import java.util.*;
    // The compiler provides us with a default constructor and creates a hand object, which
    // contains a empty Stack or empty hand. We then add a card object by pushing it into
    // our Stack or hand.
    class Hand
      private Stack hand = new Stack();   // Stores the cards in the hand
      public void add(Card card)
        hand.push(card);
    // This method pulls a single card from the Hand.
      public Card getCard()
        return (Card)hand.pop();
    // This method returns the number of cards that are in the hand.
      public int getCardCount()
        return hand.size();
    // This method pushes the hit card back into the hand for display purposes.
       public Hand addCardBackInHand()
         return (Card)hand.push();
      // We need a way to display our hand so we use the toString() method again to display
      // a string representation of our hand object. Here I found another helpful little
      // item called the Iterator it allows me to deal one card at a time and store it in
      // my Stack hand. We also use a buffered stream because transferring data in a buffer
      // is a lot more efficient because it stores chunks of data in memory before
      // transferring the data to or from an external device.
      public String toString()
        Iterator cards = hand.iterator();
        StringBuffer str = new StringBuffer();
        while(cards.hasNext())
          str.append(" "+ (Card)cards.next());
        return str.toString();
      public int getBlackjackHandValue()
        int val;       // Value of the hand.
        boolean ace;   // This will be set to true if we have an ace in our hand.
        int cards;     // Number of cards in the hand.
    // Here we initalize our variables with a value.
        val = 0;
        ace = false;
        cards = getCardCount();
    // Here we use a for loop to loop thru the cards in the hand and then
    // determine a value for those cards.
        for (int i = 0; i < cards; i++)
          int cardVal;                // The value of the card.
          Card card;
          card = getCard();           // Get a card from the hand.
          cardVal = card.getValue();  // Get the value of the card which should
                                      // be between 1 to 13.
          if (cardVal > 10)
            cardVal = 10;  // This assigns a value of 10 to the face cards
          if (cardVal == 1)
            ace = true;   // We have an ace in our Blackjack hand.
            val = val + cardVal;
    // Since an ace can either be a 1 or 11 in blackjack we have to make
    // allowances for that so, if we have an ace and the value of the hand
    // is less than or equal to 21 we do that by adding an extra 10 points
    // to val.
          if (ace == true && val + 10 <= 21)
             val = val + 10;
          return val;  // the value of our blackjack hand.
    }Thanks...........gee mann

    Its hard to say without seeing the Classes CardDeck and Card... stilll let me guess
         listen = new ActionListener()
    public void actionPerformed(ActionEvent e)
         CardDeck deck = new CardDeck();
         deck.shuffle();
         Hand myHand1 = deck.dealHand(1);
    Card newCard = myHand1.getCard();
    // I seem to be getting the error right here.
    Hand myHand = newCard.addCardBackInHand();Are u sure the method addCardBackInHand() is in the class "Card"... I saw a method by that name in the class Hand.... Am i right?

  • JSP Tags, EL and toString() method

    Hi,
    I want to pass a Java object to a custom tag via EL, but am finding that since the class has a toString() method, EL automatically converts the class to a string using the toString method. Consequently, I get an error because the string cannot be cast back to the parent object in the tag handler class.
    I played around with a dummy class and found that if the toString() method wasn't defined, EL would pass the object as is without converting to a string.
    Is there some reason for this behaviour and is there some way I can get around this without having to remove the toString() method ? The object I am trying to process is from an external library, so I can't modify it.
    Thanks for any tips on this.
    Paul Samuel

    My initial guess was that you hadn't defined the type of the attribute, and it was defaulting to String as a result. Now that I've seen the tld file thats obviously not the cause.
    Next guess: EL evaluation is disabled, and it is interpreting ${model.results} as a string, rather than evaluating it.
    1 - What happens if you just put ${1 + 1} onto a JSP page. Does it print ${1 + 1} or evaluate it as 2?
    2 - What server are you using? What version? Which J2EE spec does it support?
    You can use the following JSP snippet to confirm this info:
    <h2> Server Info</h2>
    Server info = <%= application.getServerInfo() %> <br>
    Servlet engine version = <%=  application.getMajorVersion() %>.<%= application.getMinorVersion() %><br>
    Java version = <%= System.getProperty("java.vm.version") %><br>
    Session id = <%= session.getId() %><br>3 - What version is your web.xml declared as? 2.3 or 2.4?
    4- If you have a Servlet2.4/JSP2.0 container (eg Tomcat 5), try putting the following on your page and see if it works
    <%@ page isELIgnored="false" %>
    http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0
    Cheers,
    evnafets

  • Problem Using toString method from a different class

    Hi,
    I can not get the toString method to work from another class.
    // First Class Separate file MyClass1.java
    public class MyClass1 {
         private long num1;
         private double num2;
       public MyClass1 (long num1, double num2) throws OneException, AnotherException {
            // Some Code Here...
        // Override the toString() method
       public String toString() {
            return "Number 1: " + num1+ " Number 2:" + num2 + ".";
    // Second Class Separate file MyClass2.java
    public class MyClass2 {
        public static void main(String[] args) {
            try {
               MyClass1 myobject = new MyClass1(3456789, 150000);
               System.out.println(myobject);
             } catch (OneException e) {
                  System.out.println(e.getMessage());
             } catch (AnotherException e) {
                  System.out.println(e.getMessage());
    }My problem is with the System.out.println(myobject);
    If I leave it this way it displays. Number 1: 0 Number 2: 0
    If I change the toSting method to accept the parameters like so..
    public String toString(long num1, double num2) {
          return "Number 1: " + num1 + " Number 2:" + num2 + ".";
       }Then the program will print out the name of the class with some garbage after it MyClass1@fabe9. What am I doing wrong?
    The desired output is:
    "Number 1: 3456789 Number 2: 150000."
    Thanks a lot in advance for any advice.

    Well here is the entire code. All that MyClass1 did was check the numbers and then throw an error if one was too high or too low.
    // First Class Separate file MyClass1.java public class MyClass1 {
         private long num1;
         private double num2;
         public MyClass1 (long num1, double num2) throws OneException, AnotherException {              
         // Check num2 to see if it is greater than 200,000
         if (num2 < 10000) {
                throw new OneException("ERROR!:  " +num2 + " is too low!");
         // Check num2 to see if it is greater than 200,000
         if (num2 > 200000) {
                throw new AnotherException ("ERROR!:  " +num2 + " is too high!");
         // Override the toString() method
         public String toString() {
              return "Number 1: " + num1+ " Number 2:" + num2 + ".";    
    // Second Class Separate file MyClass2.java
    public class MyClass2 {
        // Main method where the program begins.
        public static void main(String[] args) {
            // Instantiate first MyClass object.
            try {
               MyClass1 myobject = new MyClass1 (3456789, 150000);
               // if successful use MyClass1 toString() method.
               System.out.println(myobject);
                         // Catch the exceptions within the main method and print appropriate
                         // error messages.
             } catch (OneException e) {
                  System.out.println(e.getMessage());
             } catch (AnotherException e) {
                  System.out.println(e.getMessage());
             }I am not sure what is buggy. Everything else is working fine.

  • Using a toString() method to round decimals

    I've been working on this project for school, building a class which models cartesian coordinates and can also convert them to polar coordinates. After much work I have a working product with some time to spare. Theres a small amount of extra credit to be gained if i can use toString() methods to manipulate my results to be exactly to two decimal places.
    I've been looking at the api documentation, which is what my teacher suggested, but its a little tough for a rookie like me to wade through. A point in the right direction or any help would be greatly apreciated.
    Thanks in advance

    I understand, I just dont want yall to feel like youre doing all the work for me.
    Anyways i searched google and using what i saw on this site
    http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Tech/Chapter05/decimalFormat.html
    adapted what i could to my class and came up with this
    String fmt = "0.00";
      DecimalFormat df = new DecimalFormat( fmt );
      String str_x = df.format(x);
      String str_y = df.format(y);
      public String toString()
        return "( " + str_x + ", " + str_y + " )";
      }x and y are the instance variables im using for my class: Coord
    when i try to compile i get these two error messages:
    Coord.java:133: cannot find symbol
    symbol : class DecimalFormat
    location: class Coord
    DecimalFormat df = new DecimalFormat( fmt );
    ^
    Coord.java:133: cannot find symbol
    symbol : class DecimalFormat
    location: class Coord
    DecimalFormat df = new DecimalFormat( fmt );
    ^
    I assume these errors mean my syntax is off but hopefully im headed in the right direction.

  • ToString method why its not called implicitly for objects

    class Building { }
    public class Example
    public static void main()
    Building b = new Building();
    String s = (String)b;
    in the 5th Line it shows error that cannot cast building type to string..
    but all classes have the toString method which is called whenever we give the object arguement in System.out.println();
    the following code compiles
    class Building { }
    class Example
    public static void main()
    Building b = new Building();
    System.out.println(b);
    can anyone explain this?

    I get your point about casting.
    but in the println statement when u pass the building object it calls the toString method and generates a new string object
    why does not it do the same in the below code.
    String s = b;// b is a building object
    is the tostring method implicitly called only in println where it expects a string?

  • No such method error when launching the Interactive form

    Hi Experts,
    I have developed a simeple Java Webdynpro application and added an Interactive form without any controls in it. Created the context with one value node and a binary value attribute.
    I have assigned  value node to datasource and binary attribute to pdfSource. When I launch the application I am getting the following no such method error.
    java.lang.NoSuchMethodError: com/sap/tc/webdynpro/clientserver/uielib/adobe/api/IWDInteractiveForm.setTemplateSource(Ljava/lang/String;)V
    The currently executed application, or one of the components it depends on, has been compiled against class file versions that are different from the ones that are available at runtime.
    If the exception message indicates, that the modified class is part of the Web Dynpro Runtime (package com.sap.tc.webdynpro.*) then the running Web Dynpro Runtime is of a version that is not compatible with the Web Dynpro Designtime (Developer Studio or Component Build Server) which has been used to build + compile the application.
    My NWDS is of Version 7.0.06
    and J2EE Engine is of Version 6.40.
    any guess why I am getting this error.
    Thanks
    Chinna.

    Issue solved. Compatablility issue NWDS 2.0 Version should use for NW 2004.

  • Using JOptionPane to exit program & Using toString method

    Hello,
    In my program I have to use a toString method below
    public String toString(Hw1NCBEmployee[] e)
            String returnMe = String.format(getStoreName() + "\n" + getStoreAddress() + "\n" + getCityState() +  "\nYou have " + getEmpCount() + "employee(s)");
            return returnMe;
    }Now, at first, when I initially tested my code, it was working just fine, printing out the right way
    Point is -- now that Im practically finished with my program, and am going back and running it - calling the toString method gives me the address rather than the information . . . Can anyone help me with this issue??
    Also, Im using JOptionPane to display everything, but -- at first, it worked fine, then (around the same time I started having the above problem) it stopped exiting the do-while loop:
    while(go)
                 int option = JOptionPane.showConfirmDialog(null, "Do you want to enter employee information?", "Welcome!", JOptionPane.YES_NO_OPTION);
                     if(option == JOptionPane.NO_OPTION)
                        go = false;  //exit loop
            

    ncjb wrote:
    well, for the toString - I have to print out the info inside the array -- am I right in thinking that the only way to do this is to pass in the array ??If the array is part of the class then there is no need to pass it as a parameter. If it is being passed in from outside the class then I have to question your design. Why should class X being formatting data that is not a representation of itself?
    and i have 2 other files that go with this program . . . I just want to know if there is a way to make sure that when the user presses the NO option, it will exit the loop -- the piece of code you see if apart of an entire method (not long) -- do you want me to include this??You read that link I provided REAL quick!

  • Abstract Method Error and XML Parsing

    I am using wl6sp1. I am parsing an XML file from within the
    servlet using jaxp1.1 and crimson.
    Following is code:
    1- SAXParserFactory spf = SAXParserFactory.newInstance();
    2- sp = spf.newSAXParser();
    3- xr = sp.getXMLReader();
    4- xr.setContentHandler(new ParseXML());
    5- xr.parse( new InputSource("Example3.xml"));
    This program works fine when execute from command line but in servlet on line
    3 it says:
    "Abstract Method Error"
    I have created XML Registry to use Crimson as XML parser rather than default.
    I think somehow wl is still using jaxp1.0 which is built in
    support in wlsp1.
    Whats wrong with the code...or what configuration i am missing???

    I'm assuming you have already put crimson.jar first in the classpath for the java
    command you use to start WebLogic. If so, have you tried putting the servlet in
    a .war file with the crimson.jar in its' WEB-INF/lib directory?
    Regards,
    Mike Wooten
    "anyz" <[email protected]> wrote:
    >
    I am using wl6sp1. I am parsing an XML file from within the
    servlet using jaxp1.1 and crimson.
    Following is code:
    1- SAXParserFactory spf = SAXParserFactory.newInstance();
    2- sp = spf.newSAXParser();
    3- xr = sp.getXMLReader();
    4- xr.setContentHandler(new ParseXML());
    5- xr.parse( new InputSource("Example3.xml"));
    This program works fine when execute from command line but in servlet
    on line
    3 it says:
    "Abstract Method Error"
    I have created XML Registry to use Crimson as XML parser rather than
    default.
    I think somehow wl is still using jaxp1.0 which is built in
    support in wlsp1.
    Whats wrong with the code...or what configuration i am missing???

  • Abstract Method Error in retrieving Blob

    Hi!
    while (rs.next())
    Blob blob=rs.getBlob(1);
    throws Abstract Method Error
    why?
    Thanxs in advance

    You'll probably find that the JDBC driver that you are using doesn't support blobs. Check the documentation that comes with your driver, it should tell you what parts of the JDBC specification it supports.
    Col

  • Server error: Class: UCF Acroform Method error Message: Could not send mess

    Hi Gurus,
    I'm having a problem with displaying PDF file in the portal. I tried reinstalling Adobe 9. Tick and untick the option Display PDF in browser. But still encountering the error. Is it something to do with IE version? Please Help. Thanks in advance.
    Server error: Class: UCF Acroform Method error Message: Could not send message

    Hi,
        Please speify the system information so that I can help you
    Regards
    Sharanya.R

  • ToString() method in my User defined Exception...How is it getting called ?

    CustomException.java
    public class CustomException extends Exception
         private int age;
         public CustomException(int age)
         this.age = age;
         public String toString()
         return "this is my exception";
    ExceptionTest.java
    public class ExceptionTest
         static int age=-1;
         public static void main(String args[]) throws Exception
              if(age<0)
              throw new CustomException(age);
    After executing ExceptionTest.java , the result is
    Exception in thread "main" this is my exception at ExceptionTest.main(ExceptionTest.java:8)
    I am just throwing CustomException , to my knowledge only the constructor should run ?
    What i see is message "this is my exception" is within the toString() method - which i never called.
    From where is the toString() method getting called ?
    Also ,
    If I want an object of my class to be thrown as an exception object, what should I do?

    Your main method is defined as throwing Exception, so the JVM catches the Exception (since nothing in your code does). And it does the equivalent of e.printStackTrace() which, among other things, outputs the result of toString().

  • HTTP GET method error

    I've created a simple web page that contains a text box in which the user enters an URL. And also have a servlet to take this address and do something "useful" with it. The Servlet has a doPost method to get this address, and the web page also has the corresponding method
    (<FORM method="POST" ACTION="../fyp/AddressServlet" >).
    I'm using a j2ee server, which runs fine, as does the deploytool.
    However, when I attempt to open the web page in my browser, I get the following error,
    "HTTP Status 405-HTTP method GET is not supported by this URL"
    I don't know why I'm getting a GET method error, when it's a POST method I'm using.
    Any help would be appreciated,
    thanks,
    ahhfor

    Hi !
    You're using the POST method to call the servlet when you submit the HTML page. However, when you try to load your HTML page into the browser, this is done with GET !
    Check your server.xml file in the /conf directory and see if your application context is correctly defined. And then check the web.xml file in your application's WEB-INF directory. Finally, check your path to the servlet in your HTML file.

  • How  to override toString() method ?

    class  Test
    String x[];
    int c;
    Test(int size)
    x=new String[size];
    c=-1;
    public void addString(String str)
    x=new String
    x[++c]=str;
    public void String toString()
    //  i want to override toString method to view the strings existing in the x[]...
    //   how do i view the strings ?
    //  probabily i should NOT use println() here (..as it is inside tostring() method ..right? )
    //   so i should  RETURN   x[] as an array...but the  toString() method return  type is String not the String array!.
    //   so i am in trouble.
    so in a simple way my question is how do i override toString() method to view the Strings stored in the array ?
    i am avoiding println() bcoz of bad design.
    }

    AS you said, the toString method returns a String - this String is supposed to be a representation of the current instance of your class's state. In your case, your class's state is a String array, so you just pick a format for that and make a String that fits that format. Maybe you want it to spit out something like:
    Test[1] = "some string"
    Test[2] = "some other String"If so, code something like:public String toString() {
        StringBuffer returnValue = new StringBuffer();
        for (int i = 0; i < x.length; i++) {
            returnValue.append("Test[" + i + "] = \"" + x[i] + "\"";
        return returnValue.toString();
    } If you don't mind the formatting of the toString method that Lists get, you could just do something like:public String toString() {
        return java.util.Arrays.asList(this).toString();
    } and call it good. That will print out something like:
    [Some String, another String, null]Depending on what's in your array.
    Good Luck
    Lee

  • Constructing toString method??

    could anybody how to construct a toString method to display my content overloading constructor.
    import java.io.FileReader;
    import java.io.BufferedReader;
    import java.io.*;
    import java.lang.String;
      public class TextAnalysis{
        public String refAlpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        public int[] amountOfAlpha = new int[26];         
    public TextAnalysis( String newInputData )
       try
        FileReader fr = new FileReader(newInputData);
        BufferedReader br = new BufferedReader(fr);
        int charOfAlpha;
        while((charOfAlpha = br.read()) != -1 )
          char UpperChar = Character.toUpperCase((char)charOfAlpha);
          //System.out.println( UpperChar );
          int valueOfAlpha = Character.getNumericValue((char)UpperChar)-10;
          //System.out.println( valueOfAlpha );
          if( valueOfAlpha >= 0 && valueOfAlpha <= 25 )
          amountOfAlpha[valueOfAlpha] = amountOfAlpha[valueOfAlpha] + 1;
          //System.out.println ( amountOfAlpha );
         fr.close();
        catch(FileNotFoundException e)
          System.out.println("File not found");
        catch(IOException e)
          e.printStackTrace( );
    public char highestFrequencyCharacter()
      char mostLetter = '-';
      int maxIndex = 0;
      for( int i = 1; i < amountOfAlpha.length ; i++ )
         if ( amountOfAlpha[i] > amountOfAlpha[maxIndex] )
            maxIndex  =  i;                                           
        mostLetter = refAlpha.charAt(maxIndex);
        return mostLetter;
    public char lowestFrequencyCharacter()
      char lessLetter = '-';
      int lessIndex = 0;
      for( int i = 1; i < amountOfAlpha.length ; i++ )
         if ( amountOfAlpha[i] < amountOfAlpha[lessIndex] )
            lessIndex  =  i;                                           
        lessLetter = refAlpha.charAt(lessIndex);
        return lessLetter;
    public String toStrng()
      return xxxxx;// i stuck on here.
    }

    my programming should look sth like that ...could u
    give me some idea"sth" means "something", right ?
    I would like to use my toString method
    to display >>
    Sth like
    A 26 // the frequency of the character
    B 25 //
    C 21 //
    DSo why don't you do it ? You have written your class so you're best to know how these informations you want displayed can be fetched.
    Create a StringBuffer, append() other strings (I suppose that'll involve some kind of loop), and when you're finished, return the StringBuffer.toString().

Maybe you are looking for

  • Open URL in current browser window

    I'm developing an application that works side-by-side with the user's default web browser. The browser communicates with the app through a proxy, and that works great. The issue I'm having is going the other way. So far, I've only been successful ope

  • MIRO Posting in a period not yet open

    Hi Friends, We experienced an unusual behavior of the system when posting MIRO. Now we have not opened the current period in MM to facilitate pending transactions of previous fiscal year . Hence the period 12/2009 & 11/2009 (ie February & March 2010)

  • Is there any way we can stop dehydration store

    Hi All, Is there anyway we can stop dehydration store in the BPEL,i have two BPEL process deployed in the SOA Suite.i want to make sure that one BPEL should not get impacted by dehydrations Store. Please share your views. Thanks, Murali.

  • Problem in running system commands using Runtime()

    hi, i am trying to run the "dir" command in windows OS using Runtime(). But while executing the program i am getting java.io.IOException: CreateProcess: dir error=2 error. But if i replace the "dir" command by "notepad" command its working fine. belo

  • Bulk Collect Problem

    I have table Tab1 has 20 columns i have table tab2 has 10 columns , i want you uses the bulk collect insert in tab2 to tab 1 only selected columns from the tab1 . TYPE ARRAY IS TABLE OF tab2%ROWTYPE; l_tab_array ARRAY; BEGIN SELECT * BULK COLLECT INT