Placement of return statement

Hi,
I try to make the following bit of code working.
    public byte[] generateSignature(byte[] message) {
        try{
            signature.initSign(keyPair.getPrivate(), randomSource);
            signature.update(message);
            return signature.sign();
        } catch (Exception e) {
            System.out.println("An error has occured while generating the signature.");
            System.out.println("Exception: " + e.getMessage());
            e.printStackTrace();
            System.exit(1);
    }The return signature.sign() statement need to be inside a try clause. But if I compile this, I get an error: Missing Return Statement. I could use a bogus return statement, or return some bogus bytes, but I'm really looking for a better method. (The exit statement is not very nice here, but in some other cases I have no other solution but to exit with an errormessage.)
And I don't want to define this array of bytes in the class.
Any ideas how to solve this elegant?
Cheers,

The exit statement is not very nice here, but in some other cases I have no other solution but to exit with an errormessage.Yes you do, you can (and should) throw an exception to signal the failure.

Similar Messages

  • Missing return statement. Why?

    Hi guys this might be an easy one for you all.
    I am receiving the error below when compiling the class below. Any idea what kind of statement I should be returning?
    Database.java:51: missing return statement
    ^
    1 error
    public Item search(String title){
         String ItemName;
         for (int i=0; i < items.length; i++)      {
             System.out.println (items);
    ItemName = items[i].getTitle(); // polymorphism
    if (ItemName.equals(title)) {
    System.out.println ("Match Exists!");
    } else {
    System.out.println ("No matches found");

    hi
    I am sorry to disturb u.this code will work fine .pls go throw the code.we have to add return statement in the two place.previously it was in loop only.Let me know the response pklease .public Item search(String title){
         String ItemName;
         for (int i=0; i < items.length; i++)      {
             System.out.println (items);
    ItemName = items[i].getTitle(); // polymorphism
    if (ItemName.equals(title)) {
    System.out.println ("Match Exists!");
    return items[i];
    } else {
    System.out.println ("No matches found");
    return null;
    return null;

  • RETURN STATEMENT IN A PROC PROGRAM

    HI,
    I have written a small program in proc which is supposed to pick
    up records from a table matching a certain criteria.The records
    will be displayed in the screen one after the other. For every
    record displayed there is an option to perform certain
    operations such as
    (1) authorise the record which will update certain values to
    certain fields in the table
    (2) skip the record which would display the next record from the
    cursor
    (3) Reject the record which will delete it from the table and
    then fetch the next record from the cursor
    (4) quit - which should return control out of the function to
    the place where the function was called. This has been done by
    way of a return statement.
    There are only two ways to come out of the function
    (1) one is when the quit option is chosen as explained above
    (2) when the control goes past the last record in the cursor
    (when 1403 is raised)
    However, when the above two conditions are met (for eg I skip
    all the records and the reach the end of the cursor) or when i
    explicity choose the quit option, the control does not come out
    of the function, but keeps calling the function repeatedly .
    The only time when it comes out is when the cursor does not
    fetch any records.
    The program works perfectly fine in a solaris machine (oracle
    version 8.1.7). The problem is faced in a DEC ALPHA machine
    with an oracle 8.0.6 version.
    Has this anything to do with the machine set up, compilation
    script etc...or pls suggest what could be the other
    possibilities.
    Please note that the return statements used in the sub functions
    are working properly.
    Regards...Rajee

    If nothing strange hapens in the try code, the return
    statement will be achieved. In this case, what will
    hapen ? The code in the finally block will be executed
    ??Yes. Hence the word "finally".

  • Return statement inside try block

    what is wrong if i write code like as below...please explain me since i am new to java
    class sample{
    public String method(){
    try{
    String str="abc";
    return abc;
    catch(Exception e){}
    }

    veldhanas wrote:
    return abc;In your code there is no varible declared as abc. It is a value assigned in str.
    Suppose if the code in try statement throws exception the return statement is skipped and the
    associated catch block will get executed. So your catch block must return a result of type String.... or throw another (or the same) exception.
    In this case, since there's no way the code in the given "try" block can throw an exception, it would have been better to not even have a try/catch block in the first place.
    And almost never just swallow exceptions like that (an empty catch block). There are only a few cases where it's ok to swallow them (such as in finally blocks where you're cleaning up resources which may throw exceptions while cleaning up, and you want to continue cleaning up and ignore those kinds of exceptions).

  • Problems with asynchronous(?) function call before return statement

    I have a function as following inside a class deriving from CustomNode:
    override protected function create () : Node {
                    parseContent();
                    return group;
            }parseContent() executes a HttpRequest and then a PullParser. At least that's what it should do. But actually, it doesn't. Is this because the HttpRequest is asynchronous and is "cancelled" because of the return statement? Or can't this be the problem?

    You would have to update or create the view in the finally block of the onOutput: or onInput methods within the request.
    You could also try
    var viewContent: Node;
    override protected function create () : Node {
                    parseContent();
                    FX.deferAction(function():Void{
                           viewContent = group;
                    return Group{ content: bind viewContent }
            }I never tried that, but it might work.
    Another option is to bind the parsed content to whatever view you are pushing it to. Then whenever the request is done, the view will populate its content on the change of the variable where the content is stored.
    Example:
    var allTables: TableModel[];      
    //***************start of table list decleration****************************\\
    public var list: SwingJList = SwingJList {
        var shortcutKey: Boolean = false;
        focusTraversable: true
        selectedIndex: 0
        action: function(){
            FX.deferAction(function():Void{
                openButton.fire();
        items: bind for( table in allTables ){
            table.name
    var searchDataXml = xmlGenerator.generateSearchXMLString(searchData);
    var contentLength: Integer = searchDataXml.getBytes().length;
    def postRequest: HttpRequest = HttpRequest {
        location: "{WEB_APPLICATION_REQUEST_URL}searchData/?database={DATABASE_KEY}";
        method: HttpRequest.POST;
        headers: [
                HttpHeader {
                    name: HttpHeader.CONTENT_TYPE;
                    value: "application/xml";
                HttpHeader {
                    name: HttpHeader.CONTENT_LENGTH;
                    value: "{contentLength}";
        onStarted: function() {
            println("onStarted - started performing method: {postRequest.method} on location: {postRequest.location}");
        onConnecting: function() { println("onConnecting") }
        onDoneConnect: function() { println("onDoneConnect") }
        onWriting: function() { println("onWriting") }
        onOutput: function(os: java.io.OutputStream) {
            try {
                os.write(searchDataXml.getBytes());
            } finally {
                println("onOutput - about to close output stream.");
                os.close();
                os.flush();
        onToWrite: function(bytes: Long) { println("onToWrite - entire content to be written: {bytes} bytes") }
        onWritten: function(bytes: Long) { println("onWritten - {bytes} bytes has now been written") }
        onDoneWrite: function() { println("doneWrite") }
        onReadingHeaders: function() { println("onReadingHeaders") }
        onResponseCode: function(code:Integer) { println("onResponseCode - responseCode: {code}") }
        onResponseMessage: function(msg:String) { println("onResponseMessage - responseMessage: {msg}") }
        onResponseHeaders: function(headerNames: String[]) {
            println("onResponseHeaders - there are {headerNames.size()} response headers:");
            for (name in headerNames) {
                println("    {name}: {postRequest.getResponseHeaderValue(name)}");
        onReading: function() { println("onReading") }
        onToRead: function(bytes: Long) {
            if (bytes < 0) {
                println("onToRead - Content length not specified by server; bytes: {bytes}");
            } else {
                println("onToRead - total number of content bytes to read: {bytes}");
        onRead: function(bytes: Long) {
            // The toread variable is non negative only if the server provides the content length
            def progress =
            if (postRequest.toread > 0) "({(bytes * 100 / postRequest.toread)}%)" else "";
            println("onRead - bytes read: {bytes} {progress}");
        var parser = new XmlPullParser();
        onInput: function(is: java.io.InputStream) {
            // use input stream to access content here.
            // can use input.available() to see how many bytes are available.
            try {
                allTables = parser.processResults(is);
            } finally {
                is.close();
        onException: function(ex: java.lang.Exception) {
            println("onException - exception: {ex.getClass()} {ex.getMessage()}");
        onDoneRead: function() { println("onDoneRead") }
        onDone: function() { println("onDone") }
    postRequest.start();
    } In this case an array of tableModel names are bound to the list view.
    When the httprequest ends, it sets the parsed tableModel array to the array declared in this class.
    The list view will populate the table names from the array when the request finishes.

  • Can we use return statement in procedure?

    Can we use return statement in procedure or we can use more than one return statement in procedure?

    HamidHelal wrote:
    NOReally? Did you at least test it? You can use RETURN in procedure or in anonymous PL/SQL block. The only restriction is you can't specify return value:
    SQL> begin
      2      dbms_output.put_line('Before return');
      3      return;
      4      dbms_output.put_line('After return');
      5  end;
      6  /
    Before return
    PL/SQL procedure successfully completed.
    SQL> create or replace
      2    procedure p1
      3      is
      4      begin
      5          dbms_output.put_line('Before return');
      6          return;
      7          dbms_output.put_line('After return');
      8  end;
      9  /
    Procedure created.
    SQL> exec p1;
    Before return
    PL/SQL procedure successfully completed.
    SQL> begin
      2      dbms_output.put_line('Before return');
      3      return 99;
      4          dbms_output.put_line('After return');
      5  end;
      6  /
        return 99;
    ERROR at line 3:
    ORA-06550: line 3, column 5:
    PLS-00372: In a procedure, RETURN statement cannot contain an expression
    ORA-06550: line 3, column 5:
    PL/SQL: Statement ignored
    SQL> create or replace
      2    procedure p1
      3      is
      4      begin
      5          dbms_output.put_line('Before return');
      6          return 99;
      7          dbms_output.put_line('After return');
      8  end;
      9  /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE P1:
    LINE/COL ERROR
    5/9      PL/SQL: Statement ignored
    5/9      PLS-00372: In a procedure, RETURN statement cannot contain an
             expression
    SQL> SY.

  • Missing return statement

    Can anyone tell me why I'm getting a missing return statement error in this code?
    import java.awt.*;
    * Write a description of class Flower here.
    * @author (your name)
    * @version (a version number or a date)
    public class Flower
        protected FilledOval dot;
        protected FilledRect stem;
        protected FilledOval petal1;
        protected FilledOval petal2;
        protected static final int boundary = 100;
        protected RandomIntGenerator colorGen =
                new RandomIntGenerator(0,255);
        protected Color petalColor;
        protected Boolean flowerContains=false;
        private DrawingCanvas canvas;
        public void changeColor(Location point){
        dot = new FilledOval(point,15,15, canvas);
        dot.setColor(Color.YELLOW);
        petalColor = new Color(colorGen.nextValue(),
                                    colorGen.nextValue(),
                                    colorGen.nextValue());
        petal1.setColor(petalColor);
        petal2.setColor(petalColor);
        public void grow(Location point){
        stem = new FilledRect (dot.getX()+3, dot.getY()+10, 10, 10, canvas);
        stem.setColor(Color.GREEN);
        if (dot.getY()>boundary){
            dot.move(0,-4);
        else{
         petal1 = new FilledOval(dot.getX()-12, dot.getY()-25, 40,70,canvas);
         petal2 = new FilledOval(dot.getX()-25, dot.getY()-10, 70,40,canvas);
         dot.sendToFront();
         stem.sendToBack();
         petal1.setColor(petalColor);
         petal2.setColor(petalColor);
        public Boolean flowerContains(Location point){
            if (petal1.contains(point)){
                return true;
            else if (petal2.contains(point)){
                return true;
            else if (dot.contains(point)){
                return true;
    }

    public Boolean flowerContains(Location point){
            if (petal1.contains(point)){
                return true;
            else if (petal2.contains(point)){
                return true;
            else if (dot.contains(point)){
                return true;
        }That method returns a Boolean value. But if none of the condition gets satisfied then what is it going to return?

  • Using return statement in jsp

    Hi all,
    I am using return statement in JSP page after a redirect to stop executing that page. If the data bean is not present then it must go to previous page. When this return statement is executed the previous page is displayed but url in browser remains same. Why it is so ?. Is there any other way to tell a JSP page to stop executing and redirect to another page.
    rgds
    Antony Paul

    Hi Antony,
    do you use the "forward()" method or the "redirect()" method???
    rgds
    Howy

  • "missing return statement" error code

    well... i feel like such a n00b... I can't seem to figure out what the problem is with my code, if someone could help me, that would be great. I get an error saying 'missing return statement'. I know that I have some things in here that I don't need but I will need them as I go on making this program.
    with this code:
    import java.io.*;
    import java.math.*;
    public class Tester
         public static int time = 0;
         public static void main(String[] args) throws IOException
              System.out.println("Welcome to the 2008 Java Games!!!");
              time=1000;
              delay(100);
              //Method Name: delay
              //Method Arguments: used to wait for a given time
              //Goal of Method: Delay for a given time
         public static int delay(int time)
              try {
                   Thread.sleep(time);
              catch(InterruptedException ex) {}
              time++;
    }

    What does the error say? "Missing return statement"? Then I'm going to venture a guess and say that you're missing a return statement. If you don't know what a return statement is, then you have some learning to do:
    http://java.sun.com/docs/books/tutorial/java/javaOO/returnvalue.html
    Read that, then look at your delay() method and how you call it. And notice that you've made delay() of type "int".
    Edit: Or just have someone else give you the answer :P
    Edited by: newark on Feb 27, 2008 3:20 PM

  • Missing return statement - Java noob here

    Hi to everyone! I'll just like to ask if anyone of you can check out my code and see why I can do to correct this 'Missing return statement' problem with my code.
    From what I've been noticing, the compiler returns this statement when the return statements are inside conditional clauses. Usually I've been able to remedy it by storing it into another variable that's been instantiated outside my usual 'if' statements. But this time, it was my first time to use a 'try' statement since FileReader and FileWriter won't work without it. I tried to use the same remedy but it just doesn't work. Here's the part of the code I'm having problems with:
    public String[] sortWordList()
             try
                  FileReader fReader = new FileReader("initlist.txt");
                  BufferedReader bReader = new BufferedReader(fReader);
                  String output = bReader.readLine();
                  String[] words = output.split(",");
                  for(int counter1 = 0; counter1 < words.length; counter1++)
                        for(int counter2 = counter1 + 1; counter2 < words.length; counter2++)
                                  if(words[counter2].compareToIgnoreCase(words[counter1]) < 0)
                                       String temp = words[counter1];
                                       words[counter1] = words[counter2];
                                       words[counter2] = temp;
                   String temp = "";
                   for(int counter1 = 0; counter1 < words.length; counter1++)
                        FileWriter fWriter = new FileWriter("initlist.txt");
                       fWriter.write(words[counter1] + "," + temp);     
                       fWriter.close();
                       temp = bReader.readLine();
                   String output2 = bReader.readLine();
                  String[] words2 = output.split(",");
                  return words2;
             catch(IOException ioe)
        }The compiler points the 'Missing return statement' at the last bracket.
    BTW, just for those who are wonder what we're making, our teacher gave us a machine project where we have to make a basic dictionary (words only, we'll be doing the definitions and other stuff that's associated with the word some other time I think) with input and sort functions.
    Thanks guys!
    - Alphonse

    T.B.M wrote:
    By doing this, we're subverting the exception mechanism and totally defeating the purpose of exceptions. If you're going to catch an exception, you should handle it. Just smothering it and returning null is not handling it. If you're not going to handle it, then don't catch it, or else catch it and wrap it in a more layer-appropriate exception and re-throw.Then ideally there should be some *"return String[];"* statement inside "catch", not after it.No. Not unless there's some meaningful default value to use when the file can't be read, which does not appear to be the case here.
    If you return null, or an empty String[], then the caller will have to do an if test to know that something went wrong and that the method failed to do what it was supposed to do, and then what is the caller supposed to do in that case? The point of exceptions is to avoid those explicit tests for errors and let the "happy path" code just go on under the assumption that things are fine. If something goes wrong, an exception will be thrown and the happy path code will stop excuting, without having to explicitly test for an error condition.

  • Missing Return Statement, where do I put it?

    Hi am using some code from the Sun website, it is called the KnockKnockProtocol, and I have edited it a bit and I get a "missing return statement" error. When I put one in the server does not run at all?
    import java.net.*;
    import java.io.*;
    public class KnockKnockProtocol {
        private static final int WAITING = 0;
        private static final int SENTKNOCKKNOCK = 1;
        private static final int SENTFILE = 2;
        private static final int ANOTHER = 3;
        private static final int NUMJOKES = 5;
        private int state = WAITING;
        private int resource = 0;
        private String[] file = {"1. iTune 2. ZoneAlarm 3. WinRar 4. Audacity (Select a resource for downloading)"};
        private String[] download1 = {"You are downloading iTune.zip."};
        private String[] download2 = {"You are downloading ZoneAlarm.zip."};
        private String[] download3 = {"You are downloading WinRar.zip."};
        private String[] download4 = {"You are downloading Audacity.zip."};
        public String processInput(String theInput) {
            String theOutput = null;
            if (state == WAITING) {
                theOutput = "Here are the terms of reference. Do you accept?";
                state = SENTKNOCKKNOCK;
            } else if (state == SENTKNOCKKNOCK) {
                if (theInput.equalsIgnoreCase("Yes")) {
                    theOutput = file[resource];
                    state = SENTFILE;
                } else {
                    theOutput = "Please accept the terms of reference to continue. Do you accept?";
            } else if (state == SENTFILE) {
                if (theInput.equalsIgnoreCase("1")) {
                    theOutput = download1[resource] + " Do you want to download another?";
                    state = ANOTHER;
                } else if (state == SENTFILE) {
                    if (theInput.equalsIgnoreCase("2")) {
                        theOutput = download2[resource] + " Do you want to download another?";
                        state = ANOTHER;
                    } else if (state == SENTFILE) {
                        if (theInput.equalsIgnoreCase("3")) {
                            theOutput = download3[resource] + " Do you want to download another?";
                            state = ANOTHER;
                        } else if (state == SENTFILE) {
                            if (theInput.equalsIgnoreCase("4")) {
                                theOutput = download4[resource] + " Do you want to download another?";
                                state = ANOTHER;
                        } else {
                            theOutput = "You're supposed to select \"" +
                                    file[resource] +
                                    "\"" +
                                    " Please try again!";
                            state = SENTKNOCKKNOCK;
                    } else if (state == ANOTHER) {
                        if (theInput.equalsIgnoreCase("Yes")) {
                            theOutput = file[resource];
                        if (resource == (NUMJOKES - 1)) {
                            resource = 0;
                        } else {
                            resource++;
                        state = SENTKNOCKKNOCK;
                    } else {
                        theOutput = "Bye.";
                        state = WAITING;
                return theOutput;
    }Any ideas how to solve would be nice. Thanks.

    private String[] file = {"1. iTune 2. ZoneAlarm 3. WinRar 4. Audacity (Select a resource for downloading)"};
        private String[] download1 = {"You are downloading iTune.zip."};
        private String[] download2 = {"You are downloading ZoneAlarm.zip."};
        private String[] download3 = {"You are downloading WinRar.zip."};
        private String[] download4 = {"You are downloading Audacity.zip."};<nitpick>
    Do you understand what arrays are for?
    </nitpick>

  • Missing return statement question

    I got a missing return statement error when i compile in this code but however i dont get any missing return statement errors in the second code that i pasted here.. What is the difference i didn't get it ? Thank you.
    public class primechecker {
        static double remainder = 0;
        public static boolean primecheck(int number){
             for(int i=2; i<number; i++){
                  remainder = number % i;
                  if (remainder == 0){
                       return false;
             if (remainder !=0){
                  return true;
        public static void main(String[] args) {
             System.out.print(primecheck(10));
    }That is the second code which gives no error.
    public class positiveornegative {
       public static boolean numbercheck (int number){
           boolean booleann = true;
           if(number > 0){
             return true;
           else if (number < 0){
             return false;
           else {
                return false;
        public static void main(String[] args) {
             System.out.println(numbercheck(-2));
    }

    In your first snippet, the compiler has no guarantee that the for loop will be executed at all. That leaves only one return inside an if condition which again it has no guarantee that it will ever be reached(the if test may fail). This leads the compiler to the conclusion that your method may never return anything at all. Yet it's definition says that it must return a value.

  • Missing return statement error! HOW?

    Why would the following code complain that it's missing a return statement, yet there are more than 4 return statements. All the possibilities are captured on the if statements and there are no more possibilities.
    public static double power(double b, int e)
            if(e == 0 || b == 1)
                return 1;
            else if(e > 0)
                if (b > 0)
                    return b * power(b, e - 1);
                else if (b % 2 == -1)
                    return -(power(b, -e));
            else if(e < 0)
                if(b > 0)
                    return 1 / power(b, -e);
                else if (b % 2 == 1)
                    return -(1 / power(b, -e));
        }Edited by: deyiengz on Jul 30, 2009 8:34 PM

    ejp,
    Thanks for the rapid response
    I thought there could only be these possibilities:
    1. e = 0 and b = 1
    captured in the 1st if statement
    2. e > 0 and either (b > 0 or b < 0)
    captured in the second if
    3. e < 0 and either (b > 0 or b < 0)
    captured in the Third if
    and else nothing else+
    What's remaining? This was meant to be easy, what the hell am I not seeing?
    flounder Thanks too for your response.
    I tried to remove the if on the last else if (below) but still got the error
    else
                if(b > 0)
                    return 1 / power(b, -e);
                else if (b % 2 == 1)
                    return -(1 / power(b, -e));
            }Edited by: deyiengz on Jul 30, 2009 9:14 PM

  • Missing Return Statement Hell!!

    public class EventSite
    private int siteNumber;
    public EventSite()
    siteNumber = 999;
    public int getSiteNumber()
    return siteNumber;
    public Void setSiteNumber(int n)
    siteNumber = n;
    I'm taking a java class and this won't compile...Whats wrong??
    Why the Missing return statement error?

    flounder wrote:
    NewProgramGirl wrote:
    no need it is now compiled, think it was the big "V'...thank you....soooo much!!Well that contradicts what you said in reply 4.I'm guessing we forgot the all important "Save" step of the development lifecycle.
    Speaking of development lifecycle my version control system at my new job consists of zipping my project to the main fileserver each night before I leave. Apparently the SVN will be set up any day now...

  • "Missing Return Statement" although the return statement IS there?

    Hello :) I am currently studying computing science at staffordshire university, java is one of my modules (first year) and im about half way through (still at introduction stage though)... Within my code apparently I have not returned a statement... yet to my believe the return statement is there and in the correct space, i would appreciate it if you could have a look and tell me where I am going wrong please:
    import java.util.*;
    public class ReadWriteArrayApp3
    +{+
    + public static void main(String [ ] args)+
    + {+
    + int[] nums = int double[6];+
    + double result;+
    + readArray(nums);+
    + printArray(nums);+
    + printReverse(nums);+
    + averageArray(nums);+
    result = averageArray(nums);
    + System.out.println("The average of your numbers is " + result);+
    + } // end main+
    public static void readArray(int [] a)
    + {+
    + Scanner kybd = new Scanner(System.in);+
    + System.out.println("Please enter 6 Integers");+
    + for(int i=0; i < a.length; i++)+
    + {+
    + a[i] = kybd.nextInt();+
    + }+
    + }+
    +public static void printArray(int [ ] b)+
    + {+
    + for (int i = 0; i < b.length; i++)+
    + {+
    + System.out.println(b);+
    + }+
    + }+
    + public static void printReverse(int [ ] c)+
    + {+
    + for (int i = c.length-1; i >= 0; i--)+
    + {+
    + System.out.println(c[i]);+
    + }+
    + }+
    + public static double averageArray(int [ ] d)+
    + {+
    + double sum, tot, average;+
    + for (int i = 0; i < d.length; i++)+
    + {+
    + tot = tot + d[i];+
    + average = (tot)/d.length;+
    + if ((average)=(tot/d.length))+
    + {+
    + sum = average;+
    +*  }
    + return sum;+
    + }+
    +} // end application class+
    Console states:
    javac  ReadWriteArrayApp3.java
    ReadWriteArrayApp3.java:49: missing return statement
    * ^*
    *1 error*
    Above in the code I have shown I have made a part bold... this shows the area in which console has a problem with.
    I would really appreciate any help in which I get
    Thankyou
    Victoria
    Edited by: StaffsUniJavaGirl on Nov 12, 2009 9:48 AM

    import java.util.*;
    public class ReadWriteArrayApp3
         public static void main(String [ ] args)
              int[] nums = int double[6];
              double result;
              readArray(nums);
              printArray(nums);     
              printReverse(nums);
              averageArray(nums);
              result = averageArray(nums);
              System.out.println("The average of your numbers is " + result);
         }  //  end main
         public static void readArray(int [] a)
              Scanner kybd = new Scanner(System.in);
              System.out.println("Please enter 6 Integers");
              for(int i=0; i < a.length; i++)
              a[i] = kybd.nextInt();
         public static void printArray(int [ ] b)
              for (int i = 0; i < b.length; i++)
                   System.out.println(b);
         public static void printReverse(int [ ] c)
              for (int i = c.length-1; i >= 0; i--)
                   System.out.println(c[i]);
         public static double averageArray(int [ ] d)
              double sum, tot, average;
              for (int i = 0; i < d.length; i++)
                   tot = tot + d[i];
                   average = (tot)/d.length;
                   if ((averagetot)=(tot/d.length))
                        sum = average;
         return sum;
    } // end application class*line 49 is bold*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for