Ahoj, som totalna lama z javy a potrebujem nejake tri programy napisane v jave (nemusia byt zlozite staci ak bude program pracovat v poli a pod) dakujem, popripade nejaka symbolicka odmena v podobe piva a pod.
EDIT: mohli by byt zlozitejsie ako napisal dole galen, napr. program vypocita sinus kosinus ci obvod trouholnika (take uz dal kamos tak to nie)
java - 3 programy
java - 3 programy
Naposledy upravil/-a JeffoneoN v Ut 15. Dec, 2009, 01:12, upravené celkom 1 krát.
PC1: MSI P67A-G45| Core i7 2700K ~ Noctua NH-U14S| 24GB DDR3 1600MHz Kingston XMP| MSI GTX 1060 6GB| Samsung 840PRO 256GB| Plextor M3 256GB| Samsung F1 750GB| Be Quiet! L7-530| Dell U2410| Panasonic TX-L37S20
homemade plexi case 4x Magma + NF-P12 @ 4.5V
PC2: Intel Q67| Core i5 2500| 8GB DDR3 1333MHz Zeppelin| WD Blue 500GB| Seasonic S12II SS-430GB| Samsung 19" WXGA+
homemade plexi case 4x Magma + NF-P12 @ 4.5V
PC2: Intel Q67| Core i5 2500| 8GB DDR3 1333MHz Zeppelin| WD Blue 500GB| Seasonic S12II SS-430GB| Samsung 19" WXGA+
Re: java - 3 programy
program 1:
program 2:
program 3:
PS: UTFG, dostanes aj http://java.sun.com/docs/books/tutorial ... rrays.html ... odtial su tie 3 "nejake" programy, co robia "nieco" s polom.
PPS: vseobecne zadanie, necakaj zazraky, ked dostanes odpoved
Kód: Vybrať všetko
class ArrayDemo {
public static void main(String[] args) {
int[] anArray; // declares an array of integers
anArray = new int[10]; // allocates memory for 10 integers
anArray[0] = 100; // initialize first element
anArray[1] = 200; // initialize second element
anArray[2] = 300; // etc.
anArray[3] = 400;
anArray[4] = 500;
anArray[5] = 600;
anArray[6] = 700;
anArray[7] = 800;
anArray[8] = 900;
anArray[9] = 1000;
System.out.println("Element at index 0: " + anArray[0]);
System.out.println("Element at index 1: " + anArray[1]);
System.out.println("Element at index 2: " + anArray[2]);
System.out.println("Element at index 3: " + anArray[3]);
System.out.println("Element at index 4: " + anArray[4]);
System.out.println("Element at index 5: " + anArray[5]);
System.out.println("Element at index 6: " + anArray[6]);
System.out.println("Element at index 7: " + anArray[7]);
System.out.println("Element at index 8: " + anArray[8]);
System.out.println("Element at index 9: " + anArray[9]);
}
}
Kód: Vybrať všetko
class MultiDimArrayDemo {
public static void main(String[] args) {
String[][] names = {{"Mr. ", "Mrs. ", "Ms. "},
{"Smith", "Jones"}};
System.out.println(names[0][0] + names[1][0]); //Mr. Smith
System.out.println(names[0][2] + names[1][1]); //Ms. Jones
}
}
Kód: Vybrať všetko
class ArrayCopyDemo {
public static void main(String[] args) {
char[] copyFrom = { 'd', 'e', 'c', 'a', 'f', 'f', 'e',
'i', 'n', 'a', 't', 'e', 'd' };
char[] copyTo = new char[7];
System.arraycopy(copyFrom, 2, copyTo, 0, 7);
System.out.println(new String(copyTo));
}
}
PPS: vseobecne zadanie, necakaj zazraky, ked dostanes odpoved
lava, prava, lava, prava ...