best way to draw tiles in java 2d

hello guys, i was wondering what is thebest way to cerate a tiled level, for example i have:

int [] tileMap = {
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,2,0,0,1,1,1,0,0,0,3,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 
     };

where 1 & 2 are diferent platforms, 0 are blank spaces, i have an image strip with 3 tiles.

the way im creating my tiled level is iterating above array and draw each image in the correct position, however im wondering if this is the correct way to do it i dont know if tiles work in the same way at this behind the curtain, can some one give some tips of how can i improve this, thanks in advance.
the method im using to draw those tiles is this:

public void drawBgTile(Graphics2D g2,Image[] img, int[] map,int cols, int rows, 
            int tileWidth, int tileHeight)
    {
        if( cols <=0 || rows <= 0 )
        {return;}
        
        int mapIndex = 0;
        int totalTiles = cols*rows;
        
        int width = tileWidth;   //img[0].getWidth(this);
        
        int height = tileHeight; //img[0].getHeight(this);
        
        int offsetx = cam.getOffsetX();
        int offsety = cam.getOffsetY();
//        int tilewidth=Config.TILE_WIDTH;
//        int nodib=0;
        
        //renglones
        //rows
        for(int i=0;i < rows;i++)
                {
                        //columnas
                        //columns
                        for(int j=0;j < cols;j++)
                        {
                         //checamos si el tile esta dentro de los limites de la camara
                         //si no lo esta, entonces no lo dibujamos
                            
                         //if tile is inside camera limits then is rendered otherwise
                         //not , this save a lot of process
                         if( j * tileWidth  > offsetx - tileWidth 
                           && (j * tileWidth) + tileWidth < offsetx + cam.getViewWidth() + tileWidth 
                           && i * tileHeight > offsety - tileHeight
                           && (i * tileHeight) + tileHeight < offsety + cam.getViewHeigth() + tileHeight)
                         {
                         if( map[ mapIndex ] != -1 )
                            g2.drawImage( img[ map[ mapIndex ] ], width * j, height * i, null );
                         }//if validacion si se dibuja
                             
                          if(mapIndex < totalTiles)
                             mapIndex++;
                        }//for cols
                }//for rows

        
    }//

PD: im only drawing tiles that are inside cammera offsets

I have set up tiles in my new ‘game’ and here’s how I do it. It seems to work well. I’m just going to give you the github link, and in the package ‘maps’, there are three classes, one which just has the map layout, one which loads it upon instantiation, and one which draws it in game. The tiles are 1 x 1 because that is left over from zooming the camera view in. Otherwise the actual tile sizes are 32 x 32. With all that being said, I have no idea if these are best practices or not, and would like some advice too. Also maybe I should say, in the mapEditor, “0” = non solid tile, “1” = solid tile.

thanks for your reply. actually i have been using two tilemaps, one for rendering the whole level and another to make solid tiles and slope tiles its working, but the issue comes when you want to have big levels i want to mitigate somehow the over process.