Ask Experts Questions for FREE Help !
Ask
    rahulv_97's Avatar
    rahulv_97 Posts: 1, Reputation: 1
    New Member
     
    #1

    Jan 2, 2017, 11:16 AM
    Compile time error(java)
    error description:
    compiletime error in line 69
    code:

    import java.util.Scanner;
    public class sorte
    { void sort(int n,int[] a)
    { int temp;
    for(int I=0;i<n;i++)
    { for(int j=0;j<n-i-1;j++)
    { if(a[j]>a[j+1])
    { temp=a[j+1];
    a[j+1]=a[j];
    a[j]=temp;
    }
    }
    }
    }
    void display(int x,int[] y)
    {
    for(int I=0;i<x;i++)
    {
    System.out.println(+y[i]);
    }
    }








    public class sort of
    { public static void main(String args[])
    {
    Scanner in=new Scanner(System.in);
    int[] a=new int[30];
    int[] b=new int[30];
    int[] d=new int[60];

    System.out.println("enter array size");
    int n=in.nextInt();
    System.out.println("enter the 1st array elements");
    for(int I=0;i<n;i++)
    {
    a[i]=in.nextInt();
    }
    sort(n,a);
    System.out.println("the sorted array is");
    display(n,a);
    System.out.println("enter array size");
    int c=in.nextInt();
    System.out.println("enter the 1st array elements");
    for(int I=0;i<c;i++)
    {
    b[i]=in.nextInt();
    }
    sort(c,b);
    System.out.println("the sorted array is");
    display(c,b);
    System.out.println("the merged array is:");
    int g;
    g=n+c;


    for(int I=0;i<n;i++)
    {
    d[i]=a[i];
    }
    for(int j=0;j<g-n-1;j++)
    {
    d[j]=b[j];
    }
    System.out.println("the sorted merged array is");
    sort(g,d);
    display(g,d);
    }}
    CravenMorhead's Avatar
    CravenMorhead Posts: 4,532, Reputation: 1065
    Adult Sexuality Expert
     
    #2

    Jan 3, 2017, 09:25 AM
    Hard to say without knowing what is on line 69. (I don't have the will to try to count and know it is a fruitless endeavour regardless).

    The println in the display method looks a little funky though. I am more of a C++ guy then Java though.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

How to correct this error in Java? [ 2 Answers ]

Thanks for being here... I am a landlord and I use to use this site "https://officialrecords.broward.org/oncoreV2/ImageBrowser/tiffy/TiffyApplet.jar". I use it to view county records so as I can see if any tenant may have been evicted before I rent to them. I now receive the error "Missing...

Java program error [ 1 Answers ]

Sir, program is for managing account details using jdbc but ,there error like some variable not accessible in specefic block . Please solve this problem. If you can.. //mypanel1-LogIn class mypanel1 extends JPanel { JTextField t1,t2; JButton b1,b2; mypanel1() { JLabel l1,l2; ...

Excel 2003 - Compile Error - Invalid Outside Procedure [ 2 Answers ]

Please Help! This is my first attempt at setting up a Macro in Excel 2003 and all I want to do is print out 8 worksheet pages with a macro. The first message I get says: "Unable to Record" Then I click on "OK" and it records the key strokes anyway! However, when I try to run it, I end up...

Compile error with excel 2007 [ 2 Answers ]

I have written a very basic Macros code to retrieve a photo off my server. I want it to run this macro when a person has selected a certain item off a drop down list. The problem I am having is that when I try and run the macro manually or when the workbook opens I get a an error message that...


View more questions Search