add lab5
This commit is contained in:
parent
9c691d2c72
commit
1412505d33
|
@ -1,5 +1,8 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="JavadocGenerationManager">
|
||||||
|
<option name="OUTPUT_DIRECTORY" value="$PROJECT_DIR$/JavaDoc" />
|
||||||
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="openjdk-18" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="openjdk-18" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package lab5;
|
||||||
|
|
||||||
|
public class Letter {
|
||||||
|
private char symbol;
|
||||||
|
|
||||||
|
public Letter(char symbol) {
|
||||||
|
this.symbol = symbol;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package lab5;
|
||||||
|
|
||||||
|
public class Main {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println("Done!");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package lab5;
|
||||||
|
|
||||||
|
public class Word {
|
||||||
|
private Letter[] letters;
|
||||||
|
|
||||||
|
public Word(Letter[] letters) {
|
||||||
|
this.letters = letters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Word(String wordString) {
|
||||||
|
letters = new Letter[wordString.length()];
|
||||||
|
|
||||||
|
final char[] chars = wordString.toCharArray();
|
||||||
|
for (int i = 0; i < chars.length; i++) {
|
||||||
|
letters[i] = new Letter(chars[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue