Adam Kjems

Greenhorn
+ Follow
since Dec 02, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Adam Kjems

I've been assigned to make a java search engine that can sort and display information about universities, according to certain criteria. I've decided to use xml since its universal and the data can be easily edited in excel. Can anyone suggest a good tutorial or give lend some advice on xml searching through java.
17 years ago
Hello all,
I'm currently writing a java program that allows a user to input a name that is then saved to a .txt file. It works fine if I run the program once but when I run the program again it adds the data to the same line. Is there a way I can make the program add the names to a new line of text in the .txt file. My program has multiple classes, belows is only the one that actually writes to to the file. Thanks in advance

17 years ago
Hello all,
I'm currently writing a java program that allows a user to input a name that is then saved to a .txt file. It works fine if I run the program once but when I run the program again it adds the data to the same line. Is there a way I can make the program add the names to a new line of text in the .txt file. My program has multiple classes, belows is only the one that actually writes to to the file. Thanks in advance

17 years ago
Hello all,
I am currently trying to write a loop that fills an array with 12 elements and then compares the length of that array with another array. If both arrays have equal length it prints them. If not an error code comes up. Here is my code

import java.util.*;

class myArrays
{

int allMonths;
String months;
String numbers;

int numberslength;



public void printArray(){

String[] months = new String[13];
months [1] = "January";
months [2] = "Feb";
months [3] = "Mar";
months [4] = "April";
months [5] = "May";
months [6] = "June";
months [7] = "July";
months [8] = "Aug";
months [9] = "Sept";

months [10] = "Oct";
months [11] = "Nov";
months [12] = "Dec";

///allMonths=months.length;
int array[] = new int[14];
int p=0;
//
// Arrays.fill(array, x);
// for (int x=0; x<array.length; x++) {
// Arrays.fill(array, p++);
//
// }
//
// //}
for(int i=0; i<months.length;i++){
Arrays.fill(array, p++);
if (array.length==months.length){
System.out.println("they are same length");
}
System.out.println(array[p]+"."+ months[i]);
}
17 years ago