Which return statement i should use.

I have a problem regarding the return statement that i should use in the following programe.
//Printing random letters without vowels
public class Capitals {
  public char mymethod (){
     int counter = 0;               // Counter for number of capitals generated.
    int numberToGenerate = 20;     // Number of capitals to generate.
    char symbol = 0;               // Variable to store a random character.
    // While there are still letters to generate:
          while( counter < numberToGenerate ) {
      // Generate a random symbol between A and Z:
      // This relies on the fact that the codes for the letters are in a
      // contiguous sequence from 'A' to 'Z'. If we add 1 to 'A' we get the
      // code for 'B', if we add 2 we get 'C', and so on. Thus to create a
      // random capital letter from 'A' to 'Z' we can add a random integer
      // between 0 and 25 to 'A'.
      symbol = (char)(26*Math.random() + 'A');
      switch(symbol) {
        //Vowels ignored:
        case 'A':
        case 'E':
        case 'I':
        case 'O':
        case 'U':
          break;
        default:
          //Consonant displayed:
          System.out.print(symbol + " ");
          counter++;
          break;
return symbol; // My Problem is here <<<<<<<<<<<<<
public static void main(String args[])   {
Capitals myCapitals=new Capitals();
myCapitals.mymethod();
}Can anyone kindly guide as to what return statement i should use in mymethod() so that it can be called in the main.
thanks

return types are not compulsory. there's a school of though amongst some 'C' programmers, that all functions should return something, even if the returned value is of no interest most of the time. some C compilers even force this behaviour, I think it's part of some standard but I can't remember now
anyways, methods that have something to return need a return type, those that don't can be void. if you're invoking a method just to get it to do some work, it can probably be void, but if it's doing some computation for you you'll likely want to know the result, hence it must return something

Similar Messages

  • Which Event Classes i should use for finding good indexs and statistics for queries in SP.

    Dear all,
    I am trying to use pro filer to create a trace,so that it can be used as workload in
    "Database Engine Tuning Advisor" for optimization of one stored procedure.
    Please tel me about the Event classes which i  should use in trace.
    The stored proc contains three insert queries which insert data into a table variable,
    Finally a select query is used on same table variable with one union of the same table variable, to generate a sequence for records based on certain condition of few columns.
    There are three cases where i am using the above structure of the SP, so there are three SPS out of three , i will chose one based on their performance.
    1) There is only one table with three inserts which gets  into a table variable with a final sequence creation block.
    2) There are 15 tables with 45 inserts , which gets into a tabel variable with a final
    sequence creation block.
    3)
    There are 3 tables with 9 inserts , which gets into a table variable with a final
    sequence creation block.
    In all the above case number of record will be around 5 lacks.
    Purpose is optimization of queries in SP
    like which Event Classes i should use for finding good indexs and statistics for queries in SP.
    yours sincerely

    "Database Engine Tuning Advisor" for optimization of one stored procedure.
    Please tel me about the Event classes which i  should use in trace.
    You can use the "Tuning" template to capture the workload to a trace file that can be used by the DETA.  See
    http://technet.microsoft.com/en-us/library/ms190957(v=sql.105).aspx
    If you are capturing the workload of a production server, I suggest you not do that directly from Profiler as that can impact server performance.  Instead, start/stop the Profiler Tuning template against a test server and then script the trace
    definition (File-->Export-->Script Trace Definition).  You can then customize the script (e.g. file name) and run the script against the prod server to capture the workload to the specified file.  Stop and remove the trace after the workload
    is captured with sp_trace_setstatus:
    DECLARE @TraceID int = <trace id returned by the trace create script>
    EXEC sp_trace_setstatus @TraceID, 0; --stop trace
    EXEC sp_trace_setstatus @TraceID, 2; --remove trace definition
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Anyone know which render format I should use, my film will be used on a video wall (12 screens) and I need super quality. My footage format is 1080p HD resolution 1920x1080. I will be running the project from a mac with a direct line to video wall. Thanks

    Anyone know which render format I should use, my film will be used on a video wall (12 screens) and I need super quality. My footage format is 1080p HD resolution 1920x1080. I will be running the project from a mac with a direct line to video wall. Thanks in advance.

    I do some VJ-type work, involving playback of QuickTime files from the computer to projections, and I get good results using ProRes 422. That's convenient, because ProRes 422 is such a great editing codec, too.
    Traditionally, VJs use PhotoJPEG codec, which also works well, but it's a bad editing codec. So you would have to export an edited master, then convert.
    If you want it to look as good as possible, definitely schedule some time to test the footage on the wall. You may want to change the color correction of your footage to match the projectors. And if you feed the video wall some flat gray, you can see if any of the projectors need to be  adjusted.
    I'm not sure what application you're using for playback, but QuickTime Player 7 works well. It has an option to play fullscreen on an external monitor (View > Present Movie…).

  • Which function module i should use in mereq001 for warning message

    hi all,
    when creating purchase requistion(me51n) with item and plant and material etc.when we enter different plant  for the second item which is not there in first item. we should get the warning message in the popup
    for this i have used
    fuction module EXIT_SAPLMEREQ_005
    written the following code.
      INCLUDE ZXM02U05                                                   *
    CHECK SY-TCODE = 'ME51N'.
    TABLES MARC.
    DATA : BEGIN OF I_MARC OCCURS 0,
           WERKS LIKE MARC-WERKS,
           BNFPO LIKE EBAN-BNFPO,
           END OF I_MARC.
    DATA : I_WERKS LIKE MEREQ_ITEM-WERKS.
    read table I_MARC index 1.
    if sy-subrc <> 0.
    IF I_MARC-WERKS IS  INITIAL.
       I_MARC-BNFPO = IM_DATA_NEW-BNFPO.
       I_MARC-WERKS = IM_DATA_NEW-WERKS.
    append I_MARC.
    endif.
    MOVE IM_DATA_OLD-WERKS TO I_WERKS.
    elseif IM_DATA_NEW-BNFPO > I_MARC-BNFPO
           and I_WERKS <> IM_DATA_NEW-WERKS.
      CALL FUNCTION 'POPUP_DISPLAY_MESSAGE'
        EXPORTING
        TITEL         =
          MSGID         = 'ZMMMSG'
          MSGTY         = 'W'
          MSGNO         = 001.
        MSGV1         =0
        MSGV2         =
        MSGV3         =
        MSGV4         =
    ENDIF.
    but after entering the data for first item 00010 ,data is storing in the internal table. but when i entered the data for item 00020 it storing the data in internal table. but item 00010 data is not appearing in the internal table when we give item 00020 data . i have checked in the debugging.
    please advise me what to do for the above requirement.
    thanks in advance
    rama.

    Hi Roy,
    You should use BI SDK for Java to connect to BW from Web Dynpro (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how%20to%20use%20the%20bi%20java%20sdk%20in%20a%20web%20dynpro%20application.pdf)
    http://help.sap.com/saphelp_nw04/helpdata/en/6e/011e681cf74ab4b3acf73f77653405/frameset.htm
    https://media.sdn.sap.com/public/html/submitted_docs/BW/BI_SDK_JavaDocs/bi_sdk_doc/docs/documentation.html
    /people/moya.watson/blog/2004/04/05/the-bi-java-sdk-whats-in-it-for-you
    /people/moya.watson/blog/2004/12/27/three-new-how-to-guides-for-the-bi-java-sdk
    Best regards, Maksim Rashchynski.

  • How we can decide which compensation structure we should use ?

    Hi SAP-Experts .
    Regarding Payroll , We have to compensation structures
    (a.) Payscale Structure (b.) Paygrade Structure .
    Q1. May you Plz. tell me how we can decide which structure we should use ?
           How we can differentiate these structures ?
    Q2. what is purpose of remuneration type in IT-08
    which changes these structures ?
    Thanks .
    Kind Regards.
    Rajneesh
    Edited by: rajneesh mittal on Oct 11, 2010 3:50 PM

    Hi
    - the payscale structure is used when you have salary scales depending on area/region, industry, with Min and Max values, with level that you might want to default the employee (Brussels area employees might have their own salary scale, while Paris employees might have a different salary scale - within these two big areas various criteria might be used to further cathegorize how the salaries are ) (made according to the real salary scales existing in the company, the real salaries that employees have, not necessarily with a market value of the job)
    - if you use the pay grade you will be able to say what percentage of the market job salary you offer your employee, what is the distance between levels and grades; you have a referrence salary. Basically the pay grades are more teoretical values (made after analysing the market, in comparison - we offer 80% of what the market offers for the same job)
    I hope that I could be of help,
    Adriana

  • Which design patten i should use while building API to convert from Word to PDF

    Hi all,
    I would like to build one API which will convert document to PDF which design patten in c#  I should use so that it will be scalable and secure.
    Abhijit Desai

    Hello,
    In .NET no direct support for Word Document to PDF Document Conversion. However, as far as I know, the office seems to provide api/add-in which could do this, you could check this sample:
    Word Document to PDF Conversion.
    Or checking the Document.SaveAs Method:
    https://msdn.microsoft.com/en-US/library/microsoft.office.tools.word.document.saveas(v=VS.80).aspx
    If you are using office 2007, you could use this add-in below:
    2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Which jboss Connection I should use? cluster jboss, one database

    We use EJB in jboss cluster environment. We only have one oracle database.
    our existed system use TXConnection(transactional connection) for the data insert, update and delete. Using the Connection for the data retriving.
    I think TXConnection fits to use for the distributed database. So we should change our DAO layer to use only Connection.
    Is that true?
    Need help.
    Thanks.
    Jack Tie

    Huh? Connection is an interface. You will have to use
    any implementation anyway.It is not so simple. This is a legit question because he has asking if a specific implementation is required.
    It would have been better posted in the JDBC forum. I don't know what the answer is for certain but I would lean towards yes it is required because of the clustered nature.

  • What is the if statement i should use

    Dear Experts,
    I am very close in completing my problem, I ask you once more to aid me this.
    I want to display an error but it keeps overwrite of what comes after
    e.g. a=1
    a= a+1 = 2
    a= 10 then this acts as overwrite and changes it to 10
    in my case the code is as follows,
    if (upfile.whwtyp.equals("country")) {
    system.out.println("upfile.ctyfun" +upfile.ctyfun);
    system.out.println("upfile.asocod" +upfile.asocod);
    system.out.println("upfile.Err" +upfile.Err);I am thinking of putting the if statement here but i not as easy as i thought
    whwbean.status=upfile.err; This is the overwrite to display the error
    I have tried if (upfile.err=asocod= valid=0 etc. but these dont work often it says it is a string when valid=0 is a integer.
    Please help, even a little words of thought will push in the right direction.
    Many thanks
    Ace Wong

    Hi Ace,
    If I understand you correctly, you want to store an integer value (upfile.Err) into a String (whwbean.status).
    If so, then use this:
    whwbean.status = Integer.toString(upfile.Err);Hope this is what you need,
    Chris.

  • Which invoice idoc I should use?

    Vendor sends invoice after Goords recipts. When Invoice gets created and matched to the right PO I ned to generate Idoc outbound to the 3rd party system via XI. Iam confused witch Idoc I need to use?
    ACC_INVOICE_RECEIPT03(Accounting: Post Invoice Receipt)
    or
    INVOIC02 ( Invoice / Billing Document ) ?
    Please guide me

    Hello Ram, my understanding is that INVOIC02 is a generic IDOC that can be used to post MM and FI based invoices. Configuration of your partner profile determines whether the invoice is posted to MM or FI. I'm not sure about the other IDOC ACC_INVOICE_RECEIPT03 but I will suggest you go with INVOIC02.
    Please award points if this helps.

  • Updated to 10.91 now bootcamp 5 was installed in my early 2009 macbook pro which according to Apple should use bootcamp 4.x, how do I fix this?

    I had Bootcamp 4.1.4586 with Windows 7 PRO 64 bits installed and running prior to updating to Maverick 10.91 on my early 2009 MacBook Pro 17".   Did the 10.91 Maverick update to my OSX and now Bootcamp 5 is installed and doesnt run.   HELP   how do I fix it
    Also there is no way to connect to update the drivers nor bootcamps   the servers are always full

    Blank (lighted, but black) screen with cursor at bootup
    [SOLVED] - Macbook Air Sleep/Wake problem
    Dark screen on start-up can only see curser

  • My client wants me to proof PDF files but is not clear about which Adobe product I should use

    Would Adobe Reader do the trick? I need to download the PDF files as sent to me, proof and mark them for corrections, and then email them back to my client.
    Thank you.

    Start here.

  • My friend has internet conection in6 floor. I am in 7 floor and I want to use his internet which wi-fi i should use?

    Please help me!!

    Does your friend have an Apple wireless router?
    If not, what is the make and model number of the device that provides the wireless signal?

  • Which platform I should use ?

    which java platform I should use to creat message display and settings in mobile phone ? and how can I add language code in java to show different laguage(other than English) on mobile screen ?

    Or is it the tabbed appearance of the portfolio cover which interests you? I think this might be made with Flash Builder. Very bad choice, to use Flash, in my opinion. Looks slick, certainly, but locking out all customers with iPads and Android is just lunacy. But see Adobe Digital Enterprise Platform * Demonstrating the Flash Builder-based interactive statement

  • Which version I should use

    Hi,
    I got this
    Java 1.5.0_03 or later is required for installing Oracle Solaris Studio. Make sure that Java is properly installed and run installer again.
    You can specify valid Java location using --javahome installer argument.
    Can anyone tell me which JDK version I should use there?

    Moderator Action:
    This post has been moved from the Oracle Linux forum.
    You don't have a Linux question.
    You actually don't have a JRE/JDK question.
    You have a Solaris Studio question.
    You needed to spend an extra moment choosing where to post it.
    We moved it for you.

  • What version of microsoft office i should use for my ibook with 700mhz?

    I have an ibook G3
    Im not sure which microsoft office I should use.
    I bought the 2008 one but i noticed its not compatible.
    My ibook G3 has...
    -700 MHz PowerPC G3
    -640 MB SDRAM
    Im guessing Microsoft Office 2004 but im not really sure.

    Yes, that should do (if you are running Mac OS X 10.2.8 or later).
    Check out the system requirements for Microsoft Office 2004 for Mac at Amazon.com.

Maybe you are looking for

  • How to create new Sheet in Excel file and write into it

    Hi to all, my requirement is this: I have an excel file (.xls) with multiple sheets (three sheets for precision: sheet1, sheet2 and sheet3). I must create in the same excel file new sheet, say sheet4, read data from sheet1, sheet2 and sheet3 and writ

  • Materialized view problem

    Hi all, while refreshing MV I have the following error any idea why ? SQL> exec dbms_mview.refresh('ACCT_STMT_MV','c'); BEGIN dbms_mview.refresh('ACCT_STMT_MV','c'); END; ERROR at line 1: ORA-12008: error in materialized view refresh path ORA-30036:

  • Insert internal table fieldname into itab

    Hi, I want to download data into a textfile with the fieldname of an internal table as the header line. What would be the easiest way of doing that ? For eg. PERNR     BEGDA    ENDDA        <-- is the Header 10000000  20070101  99991231     <-- is th

  • Require to connect to Oracle DB

    hi, I need to connect to an Oracle DB using JDBC drivers. Where will I get these drivers from. What all do I need to do to connect to the DB using these drivers. Is it possible to install the drivers through our application,incase they are not presen

  • Client Unmarshaling Eception

    when I run my client program: public class ComputePi { public static void main(String args[]) { String name=""; System.setSecurityManager(new RMISecurityManager()); try { name = java.net.InetAddress.getLocalHost().getHostName(); catch(Exception e) {