In J2ME to create the Display class object we use
private Display d;
d=Display.getDisplay(this);
What is this as parameter?
I know this refers to the current instance but when I write the following I get errors
d=Display.getDisplay(new MyClassName());
When I saw in book the method was written like below
static Display getDisplay(MIDlet midlet)
So then I tried this
MIDlet m;
d=Display.getDisplay(m);
But I am getting errors and I cannot even pass new MIDlet() as parameter since it’s an abstract class.
As Android says,
thisin d=Display.getDisplay(this); refers to your MIDlet.But when you write the following you get errors
It’s because you try to create MIDlet by it’s constructor. You would to see MIDlet doc: