Thanks, i got it working now!
Atleast i think so haha.
:D
public static String tostring(int[] arr) {
String str1 = null;
String strk = " ";
for (int i = 0; i < Arr.length; i++) {
Type: Posts; User: MrLowBot
Thanks, i got it working now!
Atleast i think so haha.
:D
public static String tostring(int[] arr) {
String str1 = null;
String strk = " ";
for (int i = 0; i < Arr.length; i++) {
n = 3 4 5 6 7. Thats what it should print out!
Lets just say this. I want a code that takes the info from an array, can be static or in main, and prints it out from its String method when we call for it.
Say take this one step at the time. And...
I want to get the numbers from the array without touching any lib and pass them to a string
and print them out.
Well lets start back at the begining then....
I have this class that i need to make a couple of static methods, i am not allowed to use the lib.
The main method is there to act as a testprogram...
Yeah.
Been altering the code much too from what they wanted from post 5.
public class arraykm {
static int[] arr = { 3, 4, 5, 6, 7 };
public static void main(String[] args) {
int...
Well that's good to know however.. i am not allowed to use any of the help from the lib.
And on top of that i think that i should be able to get the info from the n array and not from the
static...
Exception in thread "main" java.lang.StackOverflowError
at km222nb_lab3.Arrays.toString(Arrays.java)
at km222nb_lab3.Arrays.toString(Arrays.java:32)
at...
This is what my task says I should be able to do.
The method String toString (int [] arr) that builds a string and it prints out the content of the array.
It should be able to be used as...
I get "Cannot make a static reference to the non-static method toString() from the type Object".
I thought that i could call it from "System.out.println(toString());" in the main, but i guess that...
Hey!
The the code that i have must be able to, via a method, take an array of numbers and make them into a string and then return to print them out.
There is two parts of this code so far (two...