🦝
com/codegym/task/task03/task0318/Solution.java:40: error: cannot find symbol
public static String getString()throws MyException{
^
symbol: class MyException
location: class com.codegym.task.task03.task0318.Solution.InString
package com.codegym.task.task03.task0318;
/*
Plan to conquer the world
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.IOException;
public class Solution{
public static void main(String[] args) throws Exception {
ArrayList<String> str = new ArrayList<String>();
String a = new String();
InString is = new InString();
a = is.getString();
str.add(3, a);
InString is1 = new InString();
String b = new String();
b = is1.getString();
str.add(0, b);
String c = new String(" will take over the world");
str.add(1, c);
String d = new String("in ");
str.add(2, d);
String f = new String(" years. Mwa-ha-ha!");
str.add(4, f);
InString is2 = new InString();
is2.showKewinsWonders(str);
}
static class InString{
private String fReading;
private ArrayList<String> strng = new ArrayList<String>();
public static String getString()throws MyException{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String fReading = null;
try{
fReading = reader.readline();
}
catch(IOException e){
System.out.println(e.getMessage());
}
finally{
try{
reader.close();
}
catch(IOException e){
System.out.println(e.getMessage());
}
}
if(fReading.equals(" ") ){
throw new MyException("String can not be empty!");
}
}
public static void showKewinsWonders(ArrayList<String> st){
strng = st;
int ind = 0;
String fReading = null;
for(String fReading : strng){
fReading = strng.get(ind);
System.out.print(fReading);
if(ind == 1){
System.out.println(fReading);
}
if( ind == 3){
int g = Integer.parseInt(fReading);
System.out.print(g);
}
ind++;
}
}
}
}