一个父类的构造器自动引用了么?甚至还自动传入了一个Graphics的参数?

import java.awt.Container;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import import javax.imageio.ImageIO;
import javax.swing.*;
public class Maze extends JFrame {
public Maze(){
setSize(510,550);
setDefaultCloseOperation(3);
Container cont = this.getContentPane();
MapImage map = new MapImage();
add(map);
setVisible(true);
}
public static void main(String[] args) {
new Maze();
}
}
class MapImage extends JPanel{
private BufferedImage wall;
private int[][] map = new int[][]{
{2,1,1,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,1},
{1,1,1,1,1,1,1,1,0,1},
{1,0,0,0,0,0,1,1,0,1},
{1,0,1,0,1,1,1,1,0,1},
{1,0,1,0,0,0,0,0,0,1},
{1,0,1,1,1,1,1,1,1,1},
{1,0,0,0,0,0,0,0,0,1},
{1,1,1,1,1,1,1,1,0,3},
{1,1,1,1,1,1,1,1,1,1}};
public void paint(Graphics g){
try {
//注意下面的导入方式;很有用;在程序移植过程中,通过相对路径可以保证资源的正常加载
wall= ImageIO.read(this.getClass().getResource("/Material/brick.png"));
for(int i = 0;i<10;i++){
for(int j=0;j<10;j++){
if(this.map[i][j]==1){
g.drawImage(wall,51*i,51*j,null);
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import import javax.imageio.ImageIO;
import javax.swing.*;
public class Maze extends JFrame {
public Maze(){
setSize(510,550);
setDefaultCloseOperation(3);
Container cont = this.getContentPane();
MapImage map = new MapImage();
add(map);
setVisible(true);
}
public static void main(String[] args) {
new Maze();
}
}
class MapImage extends JPanel{
private BufferedImage wall;
private int[][] map = new int[][]{
{2,1,1,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,1},
{1,1,1,1,1,1,1,1,0,1},
{1,0,0,0,0,0,1,1,0,1},
{1,0,1,0,1,1,1,1,0,1},
{1,0,1,0,0,0,0,0,0,1},
{1,0,1,1,1,1,1,1,1,1},
{1,0,0,0,0,0,0,0,0,1},
{1,1,1,1,1,1,1,1,0,3},
{1,1,1,1,1,1,1,1,1,1}};
public void paint(Graphics g){
try {
//注意下面的导入方式;很有用;在程序移植过程中,通过相对路径可以保证资源的正常加载
wall= ImageIO.read(this.getClass().getResource("/Material/brick.png"));
for(int i = 0;i<10;i++){
for(int j=0;j<10;j++){
if(this.map[i][j]==1){
g.drawImage(wall,51*i,51*j,null);
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}