Вопрос Почему не запускается программа Java

Регистрация
7 Дек 2013
Сообщения
88
Репутация
0
Спасибо
0
Монет
0
Оформил все классы вроде правильно. Выдает "Selection does not contain a main type".

import java.util.*;
public class Reader {
int i;
int k;
public void Read(){
Scanner a = new Scanner(System.in);
System.out.println("Введите первое число");
i = a.nextInt();
System.out.println("Введите второе число");
k = a.nextInt();
}
}

public class Summa {
public static void work(String args[]){
Reader b = new Reader();
Writer c = new Writer();
b.Read();
c.l1 = Sum(b.i,b.k);
}
private static int Sum(int x, int y){
x = x + y;
return x;
}
}

public class Raznost {
public static void work(String args[]){
Reader b = new Reader();
Writer c = new Writer();
b.Read();
c.l2 = Raz(b.i,b.k);
}
private static int Raz(int x, int y){
x = x - y;
return x;
}
}

public class Proizved {
public static void work(String args[]){
Reader b = new Reader();
Writer c = new Writer();
b.Read();
c.l3 = Pro(b.i,b.k);
}
private static int Pro(int x, int y){
x = x * y;
return x;
}
}

public class Chast {
public static void work(String args[]){
Reader b = new Reader();
Writer c = new Writer();
b.Read();
c.l4 = Cha(b.i,b.k);
}
private static int Cha(int x, int y){
x = x / y;
return x;
}
}

public class Writer {
int l1;
int l2;
int l3;
int l4;
public void Write(String args[]){
System.out.println("Сумма чисел: " + l1);
System.out.println("Разность чисел: " + l2);
System.out.println("Произведение чисел: " + l3);
System.out.println("Частица чисел: " + l4);
}
}
 
Назад
Сверху