Click here to Skip to main content
15,887,434 members
Home / Discussions / Java
   

Java

 
Questionimage and video trapping using with mobile camera in java and j2me language code Pin
anand pal8-Feb-13 20:44
anand pal8-Feb-13 20:44 
AnswerRe: image and video trapping using with mobile camera in java and j2me language code Pin
Richard MacCutchan8-Feb-13 23:07
mveRichard MacCutchan8-Feb-13 23:07 
QuestionHelp me to fix my codes in Java Pin
mobi358-Feb-13 4:47
mobi358-Feb-13 4:47 
AnswerRe: Help me to fix my codes in Java Pin
Richard MacCutchan8-Feb-13 5:36
mveRichard MacCutchan8-Feb-13 5:36 
GeneralRe: Help me to fix my codes in Java Pin
mobi358-Feb-13 12:13
mobi358-Feb-13 12:13 
GeneralRe: Help me to fix my codes in Java Pin
Richard MacCutchan8-Feb-13 22:27
mveRichard MacCutchan8-Feb-13 22:27 
AnswerRe: Help me to fix my codes in Java Pin
SENTHILKANTH26-Feb-13 1:49
SENTHILKANTH26-Feb-13 1:49 
Questionplease help Pin
OmarSH7-Feb-13 2:41
OmarSH7-Feb-13 2:41 
some one please tell me what is the problem
here is the code
Java
            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 Pin
venky00287-Feb-13 3:10
venky00287-Feb-13 3:10 
GeneralRe: your solution didnt work Pin
OmarSH7-Feb-13 7:55
OmarSH7-Feb-13 7:55 
AnswerRe: please help Pin
jschell7-Feb-13 10:03
jschell7-Feb-13 10:03 
GeneralRe: please help Pin
OmarSH7-Feb-13 11:00
OmarSH7-Feb-13 11:00 
GeneralRe: please help Pin
Richard MacCutchan7-Feb-13 23:12
mveRichard MacCutchan7-Feb-13 23:12 
AnswerRe: please help Pin
pranay198817-Feb-13 3:32
pranay198817-Feb-13 3:32 
Questionhelp Pin
obamiyijacob6-Feb-13 2:49
obamiyijacob6-Feb-13 2:49 
AnswerRe: help Pin
Richard MacCutchan6-Feb-13 3:13
mveRichard MacCutchan6-Feb-13 3:13 
Questionneed help Pin
obamiyijacob6-Feb-13 2:45
obamiyijacob6-Feb-13 2:45 
AnswerRe: need help Pin
Richard MacCutchan6-Feb-13 3:12
mveRichard MacCutchan6-Feb-13 3:12 
QuestionGenerate X509 Certificate and Sign it Pin
Abdullah Alsaadi5-Feb-13 15:11
Abdullah Alsaadi5-Feb-13 15:11 
AnswerRe: Generate X509 Certificate and Sign it Pin
Sandeep Mewara5-Feb-13 18:37
mveSandeep Mewara5-Feb-13 18:37 
GeneralRe: Generate X509 Certificate and Sign it Pin
Abdullah Alsaadi5-Feb-13 18:54
Abdullah Alsaadi5-Feb-13 18:54 
GeneralRe: Generate X509 Certificate and Sign it Pin
TorstenH.5-Feb-13 22:08
TorstenH.5-Feb-13 22:08 
GeneralRe: Generate X509 Certificate and Sign it Pin
Abdullah Alsaadi6-Feb-13 12:12
Abdullah Alsaadi6-Feb-13 12:12 
Questionlist and map Pin
Swarnendu0931-Jan-13 8:40
Swarnendu0931-Jan-13 8:40 
AnswerRe: list and map Pin
Richard MacCutchan31-Jan-13 22:46
mveRichard MacCutchan31-Jan-13 22:46 

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

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