Click here to Skip to main content
       

Java

 
Questionimage and video trapping using with mobile camera in java and j2me language code Pinmemberanand pal8-Feb-13 20:44 
AnswerRe: image and video trapping using with mobile camera in java and j2me language code PinmvpRichard MacCutchan8-Feb-13 23:07 
QuestionHelp me to fix my codes in Java Pinmembermobi358-Feb-13 4:47 
AnswerRe: Help me to fix my codes in Java PinmvpRichard MacCutchan8-Feb-13 5:36 
GeneralRe: Help me to fix my codes in Java Pinmembermobi358-Feb-13 12:13 
GeneralRe: Help me to fix my codes in Java PinmvpRichard MacCutchan8-Feb-13 22:27 
AnswerRe: Help me to fix my codes in Java PinmemberSENTHILKANTH26-Feb-13 1:49 
Questionplease help PinmemberOmarSH7-Feb-13 2:41 
some one please tell me what is the problem
here is the code
            public class sortm {
	public static void main(String args[])
	{
		
		int a[]={5,3,7,2,8};
		int b[]={1,9,4,8,10};
		int i=1;
		int j=1;
		int t=0;
		int s=0;
		for( i=1;i<=5;i++)
		{
			if(a[i]>a[i+1])
				t=a[i];
			a[i]=a[i+1];
			a[i+1]=t;
			
		}
		for( i=1;i<=5;i++){
		System.out.println(a[i]);
		}
		
		for(j=0;j<=5;j++)
		{
			if(b[j]>b[j+1])
				s=b[j];
			b[j]=b[j+1];
			b[j+1]=s;
		}
		for(j=0;j<=5;j++)
		{
			System.out.println(b[j]);
		}
	}
 
}
and this what running say :
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
at sortm.main(sortm.java:14)
Answersolution for your problem Pinmembervenky00287-Feb-13 3:10 
GeneralRe: your solution didnt work [modified] PinmemberOmarSH7-Feb-13 7:55 
AnswerRe: please help Pinmemberjschell7-Feb-13 10:03 
GeneralRe: please help PinmemberOmarSH7-Feb-13 11:00 
GeneralRe: please help PinmvpRichard MacCutchan7-Feb-13 23:12 
AnswerRe: please help Pinmemberpranay198817-Feb-13 3:32 
Questionhelp Pinmemberobamiyijacob6-Feb-13 2:49 
AnswerRe: help PinmvpRichard MacCutchan6-Feb-13 3:13 
Questionneed help Pinmemberobamiyijacob6-Feb-13 2:45 
AnswerRe: need help PinmvpRichard MacCutchan6-Feb-13 3:12 
QuestionGenerate X509 Certificate and Sign it PinmemberAbdullah Alsaadi5-Feb-13 15:11 
AnswerRe: Generate X509 Certificate and Sign it PinmvpSandeep Mewara5-Feb-13 18:37 
GeneralRe: Generate X509 Certificate and Sign it PinmemberAbdullah Alsaadi5-Feb-13 18:54 
GeneralRe: Generate X509 Certificate and Sign it PinmemberTorstenH.5-Feb-13 22:08 
GeneralRe: Generate X509 Certificate and Sign it PinmemberAbdullah Alsaadi6-Feb-13 12:12 
Questionlist and map PinmemberSwarnendu0931-Jan-13 8:40 
AnswerRe: list and map PinmvpRichard MacCutchan31-Jan-13 22:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.141015.1 | Last Updated 20 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid