array 11 « array « Java Collection Q&A

Home
Java Collection Q&A
1.algorithm
2.array
3.Array Byte
4.Array Char
5.Array Convert
6.Array Dimension
7.Array Integer
8.Array Object
9.Array String
10.ArrayList
11.collection
12.comparator
13.Development
14.Garbage Collection
15.Generic
16.hash
17.HashMap
18.HashTable
19.iterator
20.LinkedList
21.List
22.Map
23.queue
24.Set
25.Sort
26.tree
Java Collection Q&A » array » array 11 

1. Help with Arrays and Jexcelapi    java-forums.org

I've finally got Jexcelapi working and am able to read cell values and print them out. Now I want to use the data I read in from the spreadsheet. I'm able to read the data, perform math operations, and print it out again... but only one cell at a time. I'm building a simple card game. I want to read the ...

2. HELP: Still having trouble getting arrays :(    java-forums.org

public class Main { public static void main(String[] args) throws FileNotFoundException, BiffException, IOException, WriteException { Random randomGenerator = new Random(); int randomMap = randomGenerator.nextInt(695)+1; MapArray mapArray = new MapArray(); CardArray masterList = new CardArray(); CardArray silverAndGoldDeck = new CardArray(); int castlePosition = mapArray.buildMapArray(randomMap); masterList.buildMasterArray(); silverAndGoldDeck.buildSilverAndGoldArrays(1,2,castlePosition); [B][COLOR="Red"]mapArray.addDeckPositionsToMap();[/COLOR][/B] mapArray.displayMapArray(); masterList.displayMasterArray(); silverAndGoldDeck.displaySilverArray(); silverAndGoldDeck.displayGoldArray(); } }

3. need help with question(method & array)    java-forums.org

can any1 explain what the question want? it would be better if any of u guys would help me do lol 1) write method that return if and onli if an integer array contains duplicate items. test this method in a program. include another method that reads a list of numbers,terminate by -999 into an array 2) write method that return ...

4. Java Array Help    java-forums.org

Hi guys! Ok so this is my first year in college and I am having a lot of trouble with my computer course which mostly consist of writing java programs. I am falling way behind in class and i have a mid term due next week. It is REALLY causing a lot of stress on me. I would usually go for ...

5. Array problem    java-forums.org

class A6c { public static void main ( String[] Argument) { double [] a; double [] c = {2,3,4,5,6,7}; a = polynom(c); for (int i = 0; i < a.length;i++) System.out.println(a[i]); } public static double [] polynom (double [] a) { double [] b = {0}; for (int i = 0; i < a.length;i++) { b[i] = i*a[i]; } return b; ...

6. Array Question    java-forums.org

I'm trying to put a filter over an image using arrays. For each given pixel, I need to take itself and the 8 surrounding pixels, multiply by the corresponding weights in the "coefs" array, and use the sum to set the new center pixel. So far, I've been able to make arrays for the pixel's 3 colors, and I have the ...

7. Help with arrays    java-forums.org

I am new currently in school for programming, and have just started learning Java. My assignment is to write a program that will have the user enter 100 temperatures then it will calculate and output the average temperature, and the max and min temperatures. I am stuck on the input part, I need to know how to code the user's input ...

8. Array for time table    java-forums.org

Array for time table [code] import static javax.swing.JOptionPane.*; public class TTable { String timeTable[][][] = new String[7][8][2]; String day_name[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; String time_name[] = {"8am", "9am", "10am", "11am", "12pm", "1pm", "2pm", "3pm"}; String name = "a"; public int new_tt(){ String temp = "a"; for(int day=0; day<=6; day++){ for(int time=0; time<=7; time++){ temp = ...

9. Array    java-forums.org

10. My Array. Help Please    java-forums.org

The no-arg constructor is supposed to be there. This is my appended code. The user should be able to input the amount of data to fill the fields how many times they want. They should also be able to view the data that they entered. Here is the appended code. Thanks Java Code: class Book { int num; static String isbn; ...

11. arrays using doubles [SOLVED]    java-forums.org

12. Array problem    java-forums.org

Dear developers, I have a 2D array of an encryption String as seen below.. C H R I S T --> the header D F F G A D D A X D A D G A Z Z Z Z I have to sort the header ascending and form another array as seen below.. C H I R S T ...

13. java arrays    java-forums.org

14. `java array    java-forums.org

i have to write a program that uses an array and from the inputted numbers i need to sort the biggest,smallest,median and mean of the numbers entered into the array this is as far as i got Java Code: class array { public static void main (String [] args) { double num1, num2, num3, num4, num5; System.out.println ("Enter a number"); num1 ...

15. New project, need some help :( (arrays)    java-forums.org

16. return array problem    java-forums.org

17. array problem    java-forums.org

18. array going out of bounds?    java-forums.org

You might want to scrap the idea of using arrays and instead create a couple of classes here, one perhaps called Award that holds a String for the award name and an int for the year, another, perhaps called AwardWinner that holds a String for the name of the person and an ArrayList for the multiple awards they've won, and then ...

19. array of iles    java-forums.org

static void Reodering_sub( ){ reodering_output= new File [vector_SA.size()-1]; try { if (vect_min.size()>1){ vect_ordered_sub.setSize(test_after_filling_ordering.size()); Collections.copy(vect_ordered_sub, test_after_filling_ordering); Reodering_sub(); test_after_filling_ordering.add(vect_min.get(0).toString()); _2nd_min_element=vect_min.get(0).toString(); vect_ordered_temp.removeElement(next_point); next_point=_2nd_min_element; vect_min.remove(vect_min.get(0).toString()); FileWriter writer_rodering_out = new FileWriter(reodering_output[y]); for (int g = 0; g < vect_ordered_sub.size(); g++) { writer_rodering_out.write(vect_ordered_sub.get(g).toString()); //writer_rodering_out.write("\r\n\r\n"); }// end for (g) loop // close wrting into file writer_rodering_out.close(); } } } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) ...

20. Arrays trouble    java-forums.org

The assignment is to write a class to work with a rain averages program. The class I had to write finds the highest and lowest months rain total, calculates total for all months, and finds the average. My class compiles with no errors, the problem I am having is the program/main class file wont compile and I am not supposed to ...

21. How do you trim part of a word off from an array?    java-forums.org

I have a program which takes user input (which is a full sentence) and returns it as an array. if the sentence the user has input include keywords which are predefined, an SQL query is run. my question is, if the user inputs a number, for example, 10000. how can i make sure that this amount is included in the SQL ...

22. using arrays    java-forums.org

public int prefixLength(String si, String sj, int n) { n= Math.min(Math.min(n, si.length()), sj.length()); // find a posible valid n // find the length of the largest prefix of si and sj for (int i= 0; i <= n; i++) if (!sj.startsWith(si.substring(0, i)) return i-1; // that last char didn't match so i-1 return n; // all n characters matched }

23. Extracting a Row/Column from An Array    java-forums.org

24. Arrays    java-forums.org

25. store array of arrays in array of arrays    java-forums.org

26. Create a Get/set for an array    java-forums.org

I am a new to programming and this is for a class, there may be a better way to accomplish the task but I do want to understand what is being taught. I am to create a class CollegeCourse, with three fields Course ID, credit Hours and Grade. & create get & set for each field; OK did that. Then I ...

27. Help with arrays please.    java-forums.org

So I am trying to make a poker game and have already scrapped and starting rewriting my almost finished program because it was the first time coding a program and I did some pretty ugly things in there. But I am remaking it now and have a slight problem. I create my two hands and sort out the cards no problem, ...

28. Circle arrays    java-forums.org

class Cercle { private double radius; public Cercle(double r) { radius = r; } public double circumference() { return 2 * Math.PI * radius; } public double surface() { return Math.PI * radius * radius; } public void afficher(String message) { System.out.printf("Circle %s \n", message); System.out.printf(" - radius : %6.2f\n", radius); System.out.printf(" - length of circumference : %6.2f\n", circumference()); System.out.printf(" - ...

29. Array highest grade    java-forums.org

Hey i need help with a program that will use an array that takes in numbers and names and outputs the highest grade and the name of the highest grades holder. Here is what I have so far. import java.util.Scanner; public class ArrayGrades { public static void main(String[]args) { int[]Grade=new int[3]; int highestNumber = Grade.length; String[]name=new String[3]; int y=0; Scanner scan=new ...

30. Array Phone book    java-forums.org

So, I just took this Java class and my teacher is possibly the worst alive and has no idea how to teach Java. But you know I'll spare you my sorrow and waste of money stories and get to my real problem. I need to make a program that uses an array, but the program has to be a "phone book" ...

31. trouble with array method    java-forums.org

only the last two elements in the array determine the result string. example: if you check this list { 2, 4, 1, 3, 5 } in your method, the result is up_order and if you check this list { 2, 4, 1, 5, 3 } the result is down_order. the logic is wrong.

32. Using Arrays    java-forums.org

I have been given a task and although some people may think im after easy answers i just wanna know what on earth im doing so very very wrong. Ive spent weeks on this and its still not working at all. I basically need options 4 and 5 to return the list of arrays for the students. the array itself seems ...

33. Java Phonebook With Arrays // HELP! //    java-forums.org

Hi all, having a bit of trouble, could use some pointers. ASSIGNMENT: Write an application that allows a user to enter the names and phone numbers of up to 20 friends. Continue to prompt the user for names and phone numbers until the user enters "zzz" or has entered 20 names, which ever comes first. When the user is finished entering ...

34. Problem with Array Use    java-forums.org

Hello, I am new to java and i have been dealing with a project right now, however i am facing a problem for which i can't find the solution. Java Code: import java.util.ArrayList; import java.util.Random; public class Realization { private int[] inGoers; private int[] outGoers; private int[] Weights; private int[][] tableA; private int[] Marked; private int[] CoverageIn; private int[] CoverageOut; private ...

35. Need Help with Arrays!    java-forums.org

/public class kassoli { public static void main(String[] args) { // Create variables and initialize them. int intVal = 3; long[] longArray = new long[5]; for (int i = 0; i < longArray.length; i++) { longArray[i] = i*i; } System.out.println("Before Mystery call:"); System.out.println("intVal: " + intVal); System.out.print("longArray: "); for (int i = 0; i < longArray.length; i++) { System.out.print(longArray[i] + " ...

36. quesion - how to display an array in an applet?    java-forums.org

i am sorry, i am a beginner in Java, and i did not really understand all what you posted let me give an idea of what i am doing in my program, the program is to ask the user he enter a number of students. then the same number of textfields must be displayed. the user has to enter students names, ...

37. Array question    java-forums.org

public class ArrayOutput { public static void main(String[] args) { int[][] myArray = { { 1, 2, 3 }, { 4, 5, 6 } }; for (int i = 0; i < myArray.length; i++) { for (int j = 0; j < myArray[i].length; j++) System.out.println("Array[" + i + "][" + j + "] = " + myArray[i][j]); } } }

38. Array Problem?    java-forums.org

Hi, I'm not exactly new to java but I do have problems every now and then, anyways I'm having a problem with this code: (code is shortened to not include excess code you don't need to know about) //code starts here public class points { String[] points; public points(Point3f[] pt) { for (int a = 0; a < getLength(pt); a++) { ...

39. Just Began: Help needed with Arrays    java-forums.org

I am just learning java, and would appreciate help for the problem below: Given an array of ints, swap the first and last elements in the array. Return the modified array. The array length will be at least 1. Here is my solution, which does not work: public int[] swapEnds(int[] nums) { int[] answer; answer = new int[nums.length]; answer = nums; ...

40. calling methode with array    java-forums.org

41. array.width?    java-forums.org

42. Adding letters to arrays??    java-forums.org

43. Arrays and use of null or empty inputs    java-forums.org

Hi there I have an assignment that I managed to to to a large extent. My problem is on how to code for a situation when the inPut numbers is null or empty. Please check the problem in it's entirety below: This method takes an array of numbers as input and returns the index of the largest number in that array. ...

44. Arrays and Null inputs    java-forums.org

I made the code look lke one below but it gives me the following error Your code caused an Exception: java.lang.NullPointerException Comments: The code should handle the possibility that the input array is null. view source print? XML Code: 01 class StudentSubmission { 02 int indexOfLargestNumber(int[ ] inputNumbers) { 03 int startIndex =0; 04 int max = inputNumbers[startIndex]; 05 int indexOfMax ...

45. java arrays need help    java-forums.org

hey thanks am tryin to hold 3 lines of values into a 2D array would i do this by import java.util.*; public class array{ public static void main(String[] args){ int num[] = { {50,20,45,82} {25,63,10,16} {12,3,45,82} }; or sumfing like this int array1 [] {50,20,45,82} int array2 [] {25,63,10,16} int array3 [] {12,3,45,82}

46. Need help with array and storing input    java-forums.org

I am working on a project that should allow user input and to store 10 midterm1 grades, 10 midterm2 grades, 10 final exam grades then add the 3 to find the minimum total grade and maximum total grade and display them to the user. I got the code running but it only allows 1 score input for each of the the ...

47. array    java-forums.org

48. array    java-forums.org

Please help me finding the error on my program. As stated below it needs to display the factorial of each 10 value in array.. But when I run this program it only display 1 value and 1 factorial. Please help on this. Thanks :) //Write a program that will input 10 integers then display the factorial of each value in array ...

49. arrays    java-forums.org

Java Code: public static void main(String[] argv) { int[][] ia = new int[][]{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; System.out.println("Sum of first level: " + sumIntArray(ia[0])); System.out.println("Sum of this 2d array: " + sumIntArray(ia)); } public static int sumIntArray(int[] ia) { int result = 0; for (int i: ia) { result += i; } return result; } // And ...

50. emptying/clearing an array    java-forums.org

public void removePlayers(Player[] client) { String G = ""; for (int i = 0; i < numPlayers; ++i) { G = G + client[i]; } JOptionPane.showMessageDialog(null, G, "Player Info", 1); } i have set up this fubction as i want to clear all the data in the array. the info is all brought forward with the string and i want to ...

51. array    java-forums.org

You need to show your code, show its input and its output and describe what is wrong with the output. Or if you're having problems with one part of the code, post the code for that problem and describe what you are trying to do. Can you describe what this statement does? It adds together the contents of two variables and ...

52. Array Help    java-forums.org

Does anybody see any problems with this? This is just were I'm starting at trying to get some tiles drawn. I looked up tutorials on 2D tile based games and around the parts with arrays they all get kinda vague, so I'm trying to wing it. Thanks for the help with the array by the way. Java Code: import java.applet.*; import ...

53. Trimming of array    java-forums.org

09-01-2010 03:18 PM #1 Paulious1 Member Join Date Sep 2010 Posts 1 Rep Power 0 Trimming of array Hi, I'm having a real headache with this project. I am trying to create a project that reads in a JPG file ( which is a scanned form) this form has an invoice number BKxxxxxx, see attached. I want the program ...

54. How Useful Are Arrays ?    java-forums.org

Arrays can be useful if you have n elements of type T and you have to manipulate them. The value of n has to be fixed before you do the manipulations and the type T also has to be known in advance and the manipulation of the elements can't be done sequentially. To most people new to programming arrays are the ...

55. Please explain to me this basics in java !! array delaration    java-forums.org

public class Driver { int[] a; // A variable is declared. [] stands for the declaration of an array. But not initialize. That means in an array you've to define how many items you want to store in advance, before use. int lastItem; public static void main(String []args){ a[0] = 4; // THIS DOES NOT WORK ?? WHY ?? PLEASE EXPLAIN:confused:.... ...

56. how to ask how many arrays you want    java-forums.org

Hello! I'm new to java and im trying to figure out how to use a scanner for how much arrays you can select. I'm browsing through the forum and I'm pretty amazed how active and friendly the java community is. Anyways i have a file named Rectangle.java where all it does is calculate the area of the given input from the ...

57. array input block    java-forums.org

can someone help me with my code....:confused: I need to block if the input has the same value ... example: if i input 1 in array[1] and then input another 1 in array[2] it will block... plz help :( here's the code: Java Code: import java.util.Arrays; import java.io.*; public class Main { BufferedReader ui = new BufferedReader(new InputStreamReader(System.in)); public String yn; ...

58. Need hmwk help with Arrays in jgrasp    java-forums.org

heres what I have so far, am i on the right track, here are my instructions and my code so far. Please help Make a class called HW1.java. In this class, write the following: A method called doubleArray that has an int array as an input parameter and returns an int array in which each element has been doubled. In the ...

59. Problem with ragged array    java-forums.org

Problem with ragged array The problem I'm having is that I need to read the data from a file into a ragged array based on country region number. I have it in an array and was attempting to just read from the array but i keep getting an array index out of bounds exception. It's a small program so ...

60. Java question - arrays    java-forums.org

hi .Please help with this java array creation problem? for (int i = 0; i < 150; i++) { radius = r.nextInt(10) + 1; point = r.nextInt(3) + 4; x = r.nextInt(1300) + 5; y = r.nextInt(800) + 5; s = new Star(point, radius, x, y); s.draw(page); //stars[i] = new Star(point, radius, x, y); //stars[i].draw(page); stars[i] = s; System.out.println(i + "-> ...

61. Question about array    java-forums.org

62. array    java-forums.org

63. How to I change the position in arrays    java-forums.org

Alright, so what I want to do is presenting an array backward... so if I have an array of length 10 (1,2,3,4,5...) I want them to come out as 10, 9, 8... I was thinking something along these lines: public class uppg1 { int[] array= {1,2,3,4,5,34,7,8,9,10}; int i; public void summa(){ for (i=0; i

64. first post, array problem    java-forums.org

65. Problem with arrays    java-forums.org

Problem with arrays Hello. I'm new to this forum and very new to programming in Java. I just started with arrays and now I have an exercise I need to complete. The goal here is to create an array of student's cvs and then: -insert a student ordered by name -list all cvs ordered by name -delete cvs with ...

66. Selecting every other array    java-forums.org

I have a text file from notebook that has 160800 values. I have successfully imported them into Java. What I need to do is cut the 160800 in half and I thought Java could do it easier and faster than me manually deleting half. Here is my code so far: package lab2; import java.io.*; import java.util.Scanner; public class Temp { public ...

67. Array problems    java-forums.org

I try to make an account program (console), with a customer class and 2 account classes that inherit from an abstract account class. My problem is that I'm trying to store historic in an array, and I only get one value when I retrieve it. For example if I make two deposits to one account and then I want to print ...

68. Infix to Postfix using array    java-forums.org

Hello all! I have an assignment to convert an infix expression in to postfix and I have to use an array rather than an actual stack, which I believe is the typical to do this process. I keep running into a problem when parentheses are in the expression and the array seems to replace operators with parentheses in the array and ...

69. Alphebetizing using arrays    java-forums.org

import java.util.Scanner; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; public class sorting { public static void main(String[] args) throws IOException, MalformedURLException { Scanner input = new Scanner(System.in); System.out.println("Please enter the name of the Sorting file: "); String file = input.next(); File sort = new File(file); Scanner scan = new Scanner(sort); while (scan.hasNextLine()) { String line = ...

70. How to find out if part of an array is empty    java-forums.org

Say we have a simple array like this: class test{ public static void main(String[] args){ int arr[] = new int[10]; for(int i=0;i<4;i++){ arr[i] = i; } for(int j=0;j

71. polymorphic arrays    java-forums.org

Java Code: public abstract class Asset { private int serialNum; private double value; private String descrip; public Asset(int serialNum, double value, String descrip) { this.serialNum = serialNum; this.value = value; this.descrip = descrip; } public void setSerialNum(int serialNum) { this.serialNum = serialNum; } public int getSerialNum() { return serialNum; } public void setValue(double value) { this.value = value; } public double ...

72. Filtering an array    java-forums.org

Im trying to make a method to filter an array say array1 has these contents 10 20 30 and array2 has 11 30 the array values are entered by the user so both arrays can be any length The method would take in these two arrays then return a new array, which has the contents of array1 plus any new numbers ...

73. Arrays    java-forums.org

Hi I am trying to solve an assignment question on Arrays... Pls see the code that i have written so far. Is there an alternative to System.exit(0) statement? import java.util.*; public class Computer { static String name; static int size; static int speed; static String make; static double price; static int quantity; public Computer(String n,int s,int sp,String m,double p,int q) { ...

74. Arrays    java-forums.org

public class arraysReversed { public static void main(String[] args) { // input from user Scanner input = new Scanner(System.in); // Declaring our variables and setting up the array double[] values;//Intializing the Array values = new double[10];//Assigning 10 integers for the array to hold //Ask the user to enter 10 integers System.out.println("Please enter ten numbers."); values = input.nextDouble(); } }

75. Strange Arrays behavior    java-forums.org

hello every one I'm making a code to calculate the mode (most frequent value or values in an array ) assuming we have only one mode ,The code I made is giving the lowest value if it is repeated even if the actual mode is the maximum value so i expand the code with adding more lines to do the same ...

76. Array    java-forums.org

class AR1 { public static void main(String[] args) { String copyfrom[]={"Hello", "this" , "is " ,"a", " copy", "example"}; String copyto[]=new String[7]; System.arraycopy(copyfrom,0,copyto,0,6); System.out.println("the copi String at 0 : " + copyto[0]); System.out.println("the copi String at 0 : " + copyto[1]); System.out.println("the copi String at 0 : " + copyto[2]); System.out.println("the copi String at 0 : " + copyto[3]); System.out.println("the copi ...

77. Arrays help    java-forums.org

can anyone write in psuedocode for me..Dont know how to start.1. Rotating array contents. Write a Java program that rotates an array of integers by the number and direction entered through the command line. For example, given lst={1,2,3,4,5,6}, your code will return: command> java rotate 3 right before l={1,2,3,4,5,6,7} after l={5,6,7,1,2,3,4} command> java rotate 2 left before l={1,2,3,4,5,6,7} after l={3,4,5,6,7,1,2}

78. return array    java-forums.org

public class bolhex{ void bubble(int v[]) { System.out.println(" entrou"); for (int i = v.length - 1; i >= 1; i--) { for (int j = 1; j <= i; j++) { if (v[j - 1] > v[j]) { int aux = v[j]; v[j] = v[j - 1]; v[j - 1] = aux; } } } return v[]; } public static void ...

79. Problems with array    java-forums.org

import java.io.* ; class ArrayMaximum { public static void main ( String[] args ) throws IOException { int data2[][] = new int[][] {{3, 90, 5, 8, 1}, {1, 4, 4, 129, 13, 12, 58, 77, 12}, {9, 1, 13}, {0, 2,0,50, 75, 77, 3, -1 }}; int sum =0; int max = data2[0][0]; for ( int row=0; row < data2.length; row++) ...

80. Need help with circular arrays    java-forums.org

//Expand the array to double its current size if the queue is full and //reallocate the array private void expand() { int newSize = 2*size; String[] newData = new String[data.length]; int j = head; for(int i=0; i

81. Compacting arrays.    java-forums.org

82. Array always adding to 0???    java-forums.org

Hi, I'm new to java. Need help. My array always adds to 0. I need to be able to add numbers and then do some calculations with it. Calculate average, highest and lowest lap etc. However, it always adds to 0. I have this code so far: package reversegear; public class ReverseGear { public static void main(String[] args) { int lap; ...

83. How do I empty my array to write new information to it?    java-forums.org

my array is an attribute of the class Movielist and contains objects from the class Movie; moviedatabase is an instance of movielist I have an "open" function and I want this to empty my array and then write new information imported from a file I know how to import information to add to my array, but in this case I must ...

84. array help!    java-forums.org

i dunno why i keep receiving cannot find symbol in the command prompt.. =( i could not compile because of the one in bold... here is my codes.. can help me find out if got anything wrong with it? private ArrayList librianList; private ArrayList L1Hrs; private ArrayList L2Hrs; public LibrianManager() { librianList = new ArrayList(); L1Hrs = new ArrayList(); L2Hrs = ...

85. Adding Arrays    java-forums.org

package project12; /** * * @author David */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here //create a table 3x3 double [][] firstTable = new double [3][3]; double [][] secondTable = new double [3][3]; double [][] sumTable; sumTable = addTables(firstTable, secondTable); double [][] sum ...

86. Getting rid of duplicates in my Array problem    java-forums.org

Hi there, I'm relatively new to java and I have this one little problem which is probably quite simple, but I cant seem to get my head around it and solve it. What I am trying to do is eliminate duplicates in my array. Basically I want the user to be able to input 5 numbers, then I want it to ...

87. Saving from, and loading to an array.    java-forums.org

Hi all, basically, I want to save data from an array to a file, and then be able to load it again. The data comes to the array from a tokenizer, so I want to put the data into the file after it has been passed to the array from the tokenizer. Thanks in advance. Java Code: public void stringTokenizer(String a) ...

88. Arrays + Final = Trouble    java-forums.org

arrays are going to be my singlehanded downfall. I need to understand inside and out by 2weeks. Everything i can get my hands on to read about them seems brief and short but the hw problems are in depth and detail. I've tried to practice programming but thats shooting in the dark if i dont really understand them..any help would be ...

89. Arrays    java-forums.org

Hello there. I writing a program which uses arrays and for loops. In this program, it will ask the user to input their names and whether they are under 16. The data they entered will be stored in two arrays, adults and children. In the end it will print an invoice listing names with the amount and also the total. For ...

90. Array help    java-forums.org

Hello, and welcome to the forum. So in essence what you've done is to give us your entire assignment without asking a question and without showing any evidence of effort on your part, and I'm afraid that in this situation there's not much that we can do for you other than to direct you to a tutorial or two. I suggest ...

91. Array help :(    java-forums.org

Hello! I was wondering if it is possible to in an array to move all the elements that have the value zero to the last position in my array, and then print it out. ex. 1 2 0 4 5 to -> 1 2 4 5 0, i started to write the code but it didnt seem to work. for (int ...

92. Array's not being found.    java-forums.org

Array's not being found. Sorry for so many post's. I wish I could give back but unfortunately I'm not experienced enough to give good advice. Anyway can't figure out why my array's are not being found. Any help would be great full. This program is not finished but I am kind of stumped on this part. Please any suggestions ...

93. Array    java-forums.org

I need to make an array using primitive array so I cannot use the class ArrayList. At the moment I initialise my array as follows: array = new new String[100]; But my array will need to hold hundreds of thousands of strings, so is there a way I can make the array of maximum size? Or, to expand its size each ...

94. Array method problem    java-forums.org

Hi guys, I'm new to methods and having a problem passing the results of an array to a display method, the simple program is to enter four saving account balances and return the array + the fixed rate bonus. I can use display methods with single variables, it's displaying the array that is throwing me! here's the code: Many thanks! Java ...

95. how to grab info from array    java-forums.org

So im supposed to select the cigar and county, then put in how many boxes I want to purchase. The applet then calculates the sub total, sales tax and the total price. The code below runs so you can see how the applet is supposed to be setup minus the calculations code which is what I dont know how to do. ...

96. Input skips on array    java-forums.org

import java.util.Scanner; public class ArrraySample { public static void main(String[] args) { String[] lastname = new String [10]; String[] firstname = new String [10]; int []age = new int [10]; Scanner input = new Scanner (System.in); int n = 0; for (n = 0; n < 3; n++) { System.out.println("Input no" + (n + 1)); System.out.println("Enter last name"); lastname[n] = input.nextLine(); ...

97. Please help, arrays    java-forums.org

Hi, I have a project that I have to create a separate class, then read the data from a file into an array of objects. I am getting an error here. Then I have to list the data of the array (as is), then sort it both alphabetically and numerically, which I have not even started because I cannot even get ...

98. Array problem please help    java-forums.org

Hi, I think what you're looking for is a two-dimensional array which is indeed possible in java. Basically you can create a blank 2d array like so: whatComesHere[][] myArr = new whatComesHere[3][3]; This would create in that array three arrays each with the capacity of three separate values. Also you can create 2d arrays like so: whatComesHere [][] myArr = {{1,2,3},{4,5,6},{7,8,9}}; ...

99. array problem    java-forums.org

If you want to read an int you call the method nextInt() but you type, say, 123. The nextInt() method reads and returns 123 but it leaves the character in the input buffer. The nextLine() method reads all characters up to an character. There still is such a character in the input buffer so the nextLine() method happily reads ...

100. Array problem    java-forums.org

Hello, I am trying to write code to store integers (scores), print them out, and then display the number of scores entered. However, if you enter 3 integers it displays the 3 you entered, 2 zero's, and then tells you you entered 4 scores?! Im very confused here and have tried various if statements, loops, decrementors, etc and I am still ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.