statyczna zmienna, statyczna funkcja

0

Od niedawna uczę się Javy i mam problem.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Main
{
    public Main()
    {
        // pusty konstruktor
    }
    
    public static void main(String[] args)
    {
        //
    }
    
}

class FunctionGraph
{
    public FunctionGraph(int fromX, int toX, int fromY, int toY)
    {
        this.fromX = fromX;
        this.toX = toX;
        this.fromY = fromY;
        this.toY = toY;
    }
    
    public static void setBackgroundColor(Color backgroundColor)
    {
        this.backgroundColor = backgroundColor;
    }
    
    private static Color backgroundColor;
    private static Color lineColor;
    
    private int fromX;
    private int toX;
    private int fromY;
    private int toY;
}
0

a z czym masz dokładniej problem?

0

:D

0

w trakcie pisania tematu już się domysliłem o co biegało, ale przez przypadek wysłałem ;-P

chodziło o to, że w funkcji statycznej uzywałem this

1 użytkowników online, w tym zalogowanych: 0, gości: 1