So my understanding was that you can\'t use static method to access non-static variables, but I came across following code.
class Laptop { String memory =
try this code
public static void repair() { Laptop laptop =new Laptop(); laptop.memory="2GB"; }