Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

what should I do to compile this ? it sayis you need one main class .

0 votes
asked Jun 25, 2020 by Qrm Qrm (120 points)
private void substitute2DArray(){
    int row , col , k ;
    char tmp ;
    char[] strSAM = {'I','B','M','I','B','M'};
        k =1;
            tmp = str2D[row++][col];
            } else{

1 Answer

+1 vote
answered Jun 26, 2020 by Peter Minarik (45,000 points)
edited Jun 26, 2020 by Peter Minarik

Your code's structure should look something like this:

public class Main
    private void substitute2DArray()
        // Implement your code here

    public static void main(String[] args)

That being said, your code still would not compile, but at least, you will see compilation errors that make sense now (such as str2D is an undefined variable).

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.