How convert results to toString method

Hi All,
I am facing the problem to display the results in out.println in jsp pages like...
I thing it must convert to toSting is it right...
kindly give ur valualbe reply how to convert toString

>>>
override the toString() method in the class ofthe
the object returned by getRepCdrOptType() (classof
the reference repCdrOptType in your FormBean)
ram.pl. give more details.....What does getRepCdrOptType() return -
1. String[] ? (which is what it looks like)
In which case ur code should be like this
<%
String[] optType =
=  reportsSelectTypeForm.getRepCdrOptType();
for(int i = 0; i< optType.length ; i++){
%>
<%=optType%>
<%}%>
2. Object of some class ?? then override the
the toString() method in the class.
ram.
Thanks for your valuable reply but i am in starting of java so now i give the 3 files for u. Give the how i print the original value instance of [Ljava.lang.String;@104e28b. And also I have one more problem.That is i have 5 screens. i store the values in session and print the last page. After click finished button the control comes to first page and again goes to that flow. But i am going to second time the previouse values are displayed(like if  we check one check box. it always checked in second time also..... But i try to solve this problem to give null in reset() in form bean. But the session values r deleted when going to the next page. kindly give ur idea.
Form Bean
public class ReportsSelectTypeForm extends ValidatorForm {
     // --------------------------------------------------------- Instance Variables
     private Integer id;
     /** Report Select Type Screen Property */
     private String repSelTypeAll;
     private Integer repSelTypeValue;
     private String repSelTypeDesc;
     private String repSelTypeInd;
     /** Report CDR Options Screen Property */
     private String[] repCdrOptType = {"ISDN","IP"};
     private String[] repCdrOptDir = {"Outbound Direction"};
     private String[] repCdrOptStatus={"Success Status"};
     private String[] repCdrOptAvlFields;
     private String[] repCdrOptSelFields;
/** ----------------------------------------------- Report Select Type Screen ----------------------------------------------- */
      * Returns the id.
      * @return String
     public Integer getId() {
          return id;
      * Set the id.
      * @param id The id to set
     public void setId(Integer id) {
          this.id = id;
      * Returns the repSelTypeAll.
      * @return String
     public String getRepSelTypeAll() {
          return repSelTypeAll;
      * Set the repSelTypeAll.
      * @param repSelTypeAll The repSelTypeAll to set
     public void setRepSelTypeAll(String repSelTypeAll) {
          this.repSelTypeAll = repSelTypeAll;
      * Returns the repSelTypeValue.
      * @return String
     public Integer getRepSelTypeValue() {
          return repSelTypeValue;
      * Set the repSelTypeValue.
      * @param repSelTypeValue The repSelTypeValue to set
     public void setRepSelTypeValue(Integer repSelTypeValue) {
          this.repSelTypeValue = repSelTypeValue;
      * Returns the repSelTypeDesc.
      * @return String
     public String getRepSelTypeDesc() {
          return repSelTypeDesc;
      * Set the repSelTypeDesc.
      * @param repSelTypeDesc The repSelTypeDesc to set
     public void setRepSelTypeDesc(String repSelTypeDesc) {
          this.repSelTypeDesc = repSelTypeDesc;
      * Returns the repSelTypeInd.
      * @return String
     public String getRepSelTypeInd() {
          return repSelTypeInd;
      * Set the repSelTypeInd.
      * @param repSelTypeInd The repSelTypeInd to set
     public void setRepSelTypeInd(String repSelTypeInd) {
          this.repSelTypeInd = repSelTypeInd;
     /** ----------------------------------------------Reports CDR Options Screen  -------------------------------------------*/
      * Returns the repCdrOptType.
      * @return String
     public String[] getRepCdrOptType() {
          return repCdrOptType;
      * Set the repCdrOptType.
      * @param repCdrOptType The repCdrOptType to set
     public void setRepCdrOptType(String[] repCdrOptType) {
          this.repCdrOptType=repCdrOptType;
      * Returns the repCdrOptDir.
      * @return String
     public String[] getRepCdrOptDir() {
          return repCdrOptDir;
      * Set the repCdrOptDir.
      * @param repCdrOptDir The repCdrOptDir to set
     public void setRepCdrOptDir(String[] repCdrOptDir) {
          this.repCdrOptDir=repCdrOptDir;
      * Returns the repCdrOptStatus.
      * @return String
     public String[] getRepCdrOptStatus() {
          return repCdrOptStatus;
      * Set the repCdrOptStatus.
      * @param repCdrOptStatus The repCdrOptStatus to set
     public void setRepCdrOptStatus(String[] repCdrOptStatus) {
          this.repCdrOptStatus=repCdrOptStatus;
      * Returns the repCdrOptAvlFields.
      * @return String
     public String[] getRepCdrOptAvlFields() {
          return repCdrOptAvlFields;
      * Set the repCdrOptAvlFields.
      * @param repCdrOptAvlFields The repCdrOptAvlFields to set
     public void setRepCdrOptAvlFields(String[] repCdrOptAvlFields) {
          this.repCdrOptAvlFields=repCdrOptAvlFields;
      * Returns the repCdrOptSelFields.
      * @return String
     public String[] getRepCdrOptSelFields() {
          return repCdrOptSelFields;
      * Set the repCdrOptSelFields.
      * @param repCdrOptSelFields The repCdrOptSelFields to set
     public void setRepCdrOptSelFields(String[] repCdrOptSelFields) {
          this.repCdrOptSelFields=repCdrOptSelFields;
Action Class forward the success
JSP Page
<%@ page language="java" import="java.util.*, com.polycom.e100.ui.action.reports.*,com.polycom.e100.ui.form.reports.*"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ page language="java" contentType="text/html" %>
<jsp:useBean id="clock" class="java.util.Date" />
<script language="javascript">
     function getsubmitAction(actionValue)
          document.reportsSelectTypeForm.submitAction.value = actionValue;
</script>
<html:form action="/action/reports/dumpValues">
<html:hidden property="submitAction" value=""/>
<%
     ReportsSelectTypeForm reportsSelectTypeForm = (ReportsSelectTypeForm)session.getAttribute("reportsSelectTypeForm");
%>
<table class="form_outer_table">
     <tr>
          <td class="form_header_row">
          <bean:message key="polycom.e100.reports.viewrep.header"/>
          </td>
     </tr>
     <tr>
          <td align="center">
               <h3><bean:message key="polycom.e100.reports.viewrep.reptype"/></h3>
               <h5><bean:message key="polycom.e100.reports.viewrep.repname"/></h5>
               <h5><bean:message key="polycom.e100.reports.viewrep.repdesc"/></h5>
               <table width="600" border="0">
                    <tr>
                         <td><bean:message key="polycom.e100.reports.viewrep.repstart"/>: <% out.println(reportsSelectTypeForm.getRepSelDateStart());%> </td>
                         <td><bean:message key="polycom.e100.reports.viewrep.repend"/>: <% out.println(reportsSelectTypeForm.getRepSelDateEnd());%></td>
                         <td> </td>
                         <td> </td>
                         <td> </td>
                         <td> </td>
    <td><bean:message key="polycom.e100.reports.viewrep.reptime"/>:<jsp:getProperty name="clock" property="hours" />:<jsp:getProperty name="clock" property="minutes" /> GMT </td>
  </tr>
  <tr>
    <td colspan="7" align="center"><table class="newWizardInner" >
      <tr>
        <td align="center"><b><bean:message key="polycom.e100.reports.viewrep.repid"/></b></td>
        <td align="center"><b><bean:message key="polycom.e100.reports.viewrep.reporg"/></b></td>
        <td align="center"><b><bean:message key="polycom.e100.reports.viewrep.repdt"/></b></td>
        <td align="center"><b><bean:message key="polycom.e100.reports.viewrep.repdur"/></b></td>
        <td align="center"><b><bean:message key="polycom.e100.reports.viewrep.repctype"/></b></td>
        <td align="center"><b><bean:message key="polycom.e100.reports.viewrep.repdir"/></b></td>
          <td align="center"><b><bean:message key="polycom.e100.reports.viewrep.repbw"/></b></td>
      </tr>
      <tr>
        <td><% out.println(reportsSelectTypeForm.getId());%></td>
        <td><% out.println(reportsSelectTypeForm.getRepSelTypeInd());%></td>
        <td><% out.println(reportsSelectTypeForm.getRepSelDateStart());%></td>
        <td> </td>
        <td><% out.println(reportsSelectTypeForm.getRepCdrOptType());%></td>
        <td><% out.println(reportsSelectTypeForm.getRepCdrOptDir());%></td>
        <td><% out.println(reportsSelectTypeForm.getRepSiteOptText());%></td>
      </tr>
         </table></td>
  </tr>
  <tr>
   <td colspan="7"><table class="newBottomTab" >
      <tr><p> </p>
        <td><html:submit property="back" value="<< Back"  style="width:100px" onclick="getsubmitAction('BACK')"/>
          <html:submit property="finished" value="Finished" style="width:100px" onclick="getsubmitAction('NEXT')"/></td>
      </tr>
    </table></td>
    </tr>
</table>
<p> </p>
</td>
</tr>
</table>
</html:form>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • 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

  • Confusion with toString() method

    hi...can you please tell me how to use the toString() method? i'm trying to print out a Vector and convert whatever is in it to strings but the memory addresses keep appearing. i tried using the method to convert (ie. getNames.toString, where getNames returns a vector, but it doesnt seem to work. i dont know what the problem is. i would really appreciate your help...

    The objects in the Vector (or whatever collection
    type you use) need to implement their owntoString()
    method. Otherwise they just inherit
    java.lang.Object's implementation, which gives you
    the result you are seeing -- how should the system
    magically know what to show for a string
    representation of any willy-nilly object?Furthermore: the OP actually needs to call it on the
    Vector's elements, not on the Vector itself.Not necessarily. I believe Vector.toString() iterates over the elements in it, invoking toString() on them.

  • 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().

  • 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.
    }

    Could you please stop that:
    http://forum.java.sun.com/thread.jspa?threadID=706906&tstart=0
    http://forum.java.sun.com/thread.jspa?threadID=706907&tstart=0
    http://forum.java.sun.com/thread.jspa?threadID=706909&tstart=0

  • 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().

  • How to get the result of a method on a page

    I use JDeveloper 11g
    I want the result of a method (String) in the ApplicationModule on a page (jspx)
    What I have done is:
    1. make a method (getValue) in the ApplicationModule Algemeen (also in Client interface)
    2. make a pagedef-file with executables and bindings, see
    <executables>
    <invokeAction id="doGetValue" Binds="getValue"
    Refresh="renderModel"/>
    <variableIterator id="variables" Refresh="renderModel">
    <variable Type="java.lang.String" Name="getValueReturn"
    IsQueriable="false" IsUpdateable="0"
    DefaultValue="${bindings.getValue.result}"/>
    </variableIterator>
    </executables>
    <bindings>
    <methodAction id="getValue" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="getValue"
    IsViewObjectMethod="false" DataControl="AlgemeenDataControl"
    InstanceName="AlgemeenDataControl.dataProvider"
    ReturnName="AlgemeenDataControl.methodResults.getValue_AlgemeenDataControl_dataProvider_getValue_result"/>
    <attributeValues IterBinding="variables" id="ValueReturn">
    <AttrNames>
    <Item Value="getValueReturn"/>
    </AttrNames>
    </attributeValues>
    </bindings>
    3. on the page (jspx) I have an outputText-component:
    <h:outputText value="#{bindings.ValueReturn.inputValue}"/>
    But, it does not work, I don't get the result of the method on the screen.
    Who can help me with this?

    Hi,
    Simple example below:
    Suppose you have this method in AppmoduleImpl:
    public void testHello( ) {
    return "Hello";
    1.After you expose this to clientInterface,drop this method on the jspx page as ADF Parameter
    form
    2.Drop the return String as outputText
    3.Run the page,click on the commandButton & the outputText returns 'Hello'
    Regards,
    Shantala

  • How to enforce developers to override toString() method

    Hi,
    Right now we are in design stage of our application. I want that all our BO classes should override toString(), equals() and hashCode() methods.
    We expect that our application would be running for next 5 to 10 years, and so looking for ways to enforce these rules to developers.
    One way to do is let ant script handle such validations. Another way could be using PMD to enforce rules.
    These could be good ways of doing this, but my manager doesnot quite like to depend on external tools like these ... as 5 years down the line you donot know state of these tools.
    Can someone suggest if java provides any such provision ...
    If someone has some smart solution do let me know ... your help is much appreciated ... and thanks in advance.
    Regards,
    Rana Biswas

    This is interesting.
    toString() method is already implemented in class Object, which is inherited by all other class.
    What happens if we make toString() method abstract. I tried it and compiler allows to do it ... was wondering if it would have any side effect.
    Regards,
    Rana Biswas

  • 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

  • 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.

  • How to call a AM method with parameters from Managed Bean?

    Hi Everyone,
    I have a situation where I need to call AM method (setDefaultSubInv) from Managed bean, under Value change Listner method. Here is what I am doing, I have added AM method on to the page bindings, then in bean calling this
    Class[] paramTypes = { };
    Object[] params = { } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    This works and able to call this method if there are no parameters. Say I have to pass a parameter to AM method setDefaultSubInv(String a), i tried calling this from the bean but throws an error
    String aVal = "test";
    Class[] paramTypes = {String.class };
    Object[] params = {aVal } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    I am not sure this is the right way to call the method with parameters. Can anyone tell how to call a AM method with parameters from Manage bean
    Thanks,
    San.

    Simply do the following
    1- Make your Method in Client Interface.
    2- Add it to Page Def.
    3- Customize your Script Like the below one to Achieve your goal.
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("GetUserRoles");
    operationBinding.getParamsMap().put("username", "oracle");
    operationBinding.getParamsMap().put("role", "F1211");
    operationBinding.getParamsMap().put("Connection", "JDBC");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    i hope it help you
    thanks

  • Calling results of a method from another class

    Very very new to Java, so apologies for the lack of basic knowledge. I am making a programme with 3 classes. One class gathers details about a module. Another about the results of this module (which requires some of the information inputted for the first class). For some reason I cannot find how to use results created in the first class in this second class. How do you call the results of a method from one class in another class?
    Thanks.

    Thank you.
    I am given the following information:
    '_ModuleRecord_
    This class is used to record information about a module taken by a single student. It has a constructor that takes three parameters:
    a Module,
    an int representing the examination mark achieved by a student, and
    an int representing the coursework mark achieved by a student.
    The class has another constructor that takes a single Module parameter.'
    and the code looks like this:
    public class ModuleRecord
      public ModuleRecord(Module m, int eMark, int cMark)
      public ModuleRecord(Module m)
      } I am a bit confused by the whole thing to be honest. I assume that the Module is referring to the other class, but how do I forge the link between them here?

  • How convert a color PDF File to black & white (gray scale...no color)

    How convert a color PDF File to black & white (gray scale...no color)??? creative cloud cs6... Acrobat etc

    Hi, just wanted to add my 2¢
    I've been in publishing over 25 years and live in Acrobat for making my final files. Currently with a newspaper.
    This is what we do:
    • Tool Panes > Print Production Window
    • Select CONVERT COLORS
    • Midway down under OUTPUT INTENT, check Convert Colors to Output Intent
    • In the associated drop down menu, I choose (because I'm printing on newsprint) DOT GAIN 20% – If you're working on better stock, choose a lower dot gain percentage.
    • Click OK – this will convert the file
    • Save
    Note: this affects the file you're working with. Make sure that you use this method on a COPY if you want to retain the original color version.
    I think if you compare my method to the Preflight method, you'll see a tighter contrast and better blacks. I've always felt the Preflight method left continuous tones a little muddy.
    Now if there was only a way to add that to ACTIONS...!

  • Result Analysis Valuation Method 3

    Hi PS Experts,
    The building block document on Profit Realization 'I58_BB_ConfigGuide_EN_DE' says that as per IAS 11 and 18, we need to configure Result Analysis Valuation Method 3 only which is cost based. Is it right and whether you are all having this valuation method in your SAP system where IFRS standards are applicable.
    Then, in addition to this cost based Revenue Recognition through this valuation method 3, we would like to input realistic POC(Engineer's certificate) into the system. Whether it is possible and if so, how and what other valuation method we need to use with or with changes to a particular valuation method. Appreciate your valuable inputs on this.
    Regards!

    Hello,
    Cost based POC i.e Method 3 is compliant with IFRS requirements. Other methods also are so.
    The choice of RA method depends on value/risk/duration/revenue plan of the project. We use this method for high value projects running for a long time where there is a need to recognise revenue before actual billing.
    Completed contract method is also used and very much in accordance with accouning principles.
    For POC calculated through progress determination- say Engineer's certificate- you can use method 7.
    Thanks,

  • In fact it's about mac:excel, how convert in a cell a number written in text format into a value?

    in fact it's about mac:excel8 or 11 in OSX10.7.4,
    how convert in a cell a number written in text format into its value?
    cheers francois

    Hi francois,
    If I copyone of them and do a past special/value, it does not work.
    Try just Paste instead of Paste Special > Value
    I know your question is about Excel, but this works in Numbers:
    Copy 1 234 567 (with spaces) and Paste (not Paste Special) into a Cell in a Numbers Table. The result is 1234567 and it behaves as a number. A formula will consider it to be a number:
    You asked Wayne: what do you mean by "to reference a cell" ??
    The reference is from Cell A2 to Cell A1 through a formula, such as: =A1+1
    Regards,
    Ian.

Maybe you are looking for

  • Getting my iMac replaced???

    Hi everyone, I want to ask if I could get my iMac replaced... because since the first day it had a terrible speaker distortion, the problem is that it doesn't make it all the time, it's random (has happened with diferent applications, doing different

  • How do I move images from my external back to my computer?

    Approx. 6-7 months ago I moved all my images to my external hard drive and worked from there.  I've since upgraded to a much larger internal hard drive and want to move them back.  I intially moved them via finder and Lightroom would say that the ima

  • Sorting records dynamically in REF cursor, based upon a dynamic field

    Hi, I have a REF CURSOR built by using row type, table type and PIPELINE function. I have opened the ref cursor now. I would like to update a field called 'RANK' based upon 'RATIO' field in the REF CURSOR. i.e order the records in the ref cursor by R

  • Newbie Technical Issues

    Hi, guys. I just signed up a few minutes ago and I am the proud owner of an 8320 Curve, my very first Blackberry. Being new to all this, I have run in to some technical difficulties and I hope you experts can help me. 1. I downloaded a third party ap

  • Multiple duplicated populated playlists...

    At this point it has been going on for months...don't laugh too loudly...demented relative keeps me very busy.  Anyway, I can't take it anymore.  I have clouds beside everything like all the music is in the cloud.  Fine.  They all play.  I just don't