この質問が以前にここで尋ねられたことは知っていますが、コードの何が問題なのかを見つけることができません。
class Slider
{
public int const DEFAULT_SIZE = 20; // Problem is here. Invalid token in class
private int rise { get; set; }
private int run { get; set; }
private int size { get; set; }
int positionX = 0;
int positionY = 0;
private int leftBoundX { get; set;}
private int leftBoundY { get; set; }
private int rightBoundX { get; set; }
private int rightBoundY { get; set; }
// Constructor
Slider()
{
size = DEFAULT_SIZE;
}
private void Bound()
{
if (positionX > leftBoundX)
positionX = rightBoundX;
else if (positionY > leftBoundY)
positionY = rightBoundY;
else if (positionX > leftBoundX)
positionX = rightBoundX;
else if (positionX > leftBoundX)
positionX = rightBoundX;
}
私は物事をグーグルで検索しました.System.Collectionを含めるように言われましたが、それでも同じエラーが発生しました