Any solution? I tried to debug in eclipse it, but I am new to java so I don't really know how to use it (I tried to read about debugging and watch some vidoes on youtube).
Type: Posts; User: yellowglow
Any solution? I tried to debug in eclipse it, but I am new to java so I don't really know how to use it (I tried to read about debugging and watch some vidoes on youtube).
I created new sort method, but it doesn't work with string that has many letters in it. For example : abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz doesn't work, but words such as omnibus,...
The second sort method that I uploaded works for example with words : omnibus = bimnosu, omnibusa = abimnosu, Norm = Nmor, norm = mnor or even iamtiredofit = adefiiimortt
You are right about first...
When code doesn't work I try to run it through a program called Jeliot, but this time it crashes when it gets to the line char p = a[m]; in sort method so I can't really see what is going on after.
...
What do you mean by that?
Hi,
I am trying to do a program that takes all of the chars from a string and orders them in alphabetical order. It works fine, but when a is a last letter of a string it isn't being sorted. ...
You're right. That's why I am curious how to solve it without StringBuilder. Any advice?
public static String revio(String[] a){
int N = a.length;
StringBuilder reverse = new StringBuilder();
for (int i = 0; i < N ; i++) {
reverse.append(a[N-i-1]);
}
return...
Sorry, my bad. This is correct error:
java.lang.ArrayIndexOutOfBoundsException: 3
at ReverseMe.revio(ReverseMe.java:10)
at ReverseMe.main(ReverseMe.java:15)
at...
I went through it with Jeliot and I know that my problem is that it tries to get access to index 3 which is not in range of 0 to 2.. I know that my problem is the "return" statement which I can't fix.
java.lang.ArrayIndexOutOfBoundsException: 3
at ReverseMes.reverseConcat(ReverseMes.java:10)
at ReverseMes.main(ReverseMes.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)...
Well I've been there, but I can't find anything there that might help me.
I know that I get this error because my array starts from 0 and the last index is 2. My program tried to access to index 3...
Hi, I am beginner to Java. I wanted to create a method that will reverse elements of my array, but I keep getting error and I am not sure why.
I use Jeliot to see what are the problems, but...
{
public static void main(String args[])
{
int[] array = StdIn.readAllInts();
for (int i = 0; i<array.length;i++){
int temp = array[i];
array[i] =...
I shouldn't even use the modulo command in there..
s = s+i; It adds the last number from the loop (value of n) to s (because i!=n). It might be written as s = s+n as well. i = 2+3+4+5+...+n. There...
This is the output: 3136
Is my code so messed up?
I am not sure if this is what you mean, but these are the conditions that must be met.
1 <= i <= n
i = 1+2+3+4+...+n
s = sum of i
I'm done with the exercise and this is my outcome:
...
I took 3 java classes so far, so I don't know it yet.
Hi,
I have an assignment to do, I've been trying to do it, but I just can't find the right solution..
- What is it about?
- About an algorithm 1+2+3+4+...+n=t
(e.g.)
Input: 3, Outcome:...