lr13 -> task_1 -> e1-e14
This commit is contained in:
20
lr13/task_1/e12.java
Normal file
20
lr13/task_1/e12.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package lr13.task_1;
|
||||
|
||||
public class e12 {
|
||||
public static void m(String str, double chislo) {
|
||||
try {
|
||||
if (str == null) {
|
||||
throw new IllegalArgumentException("Строка введена неверно");
|
||||
}
|
||||
if (chislo > 0.001) {
|
||||
throw new IllegalArgumentException("Неверное число");
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
System.out.println("Error: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
m(null, 0.000001);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user