Menu
Question Index
...

Which of the following is the correct way of defining the main method?


class MeritCampus
{
    static public void main(String[] args)
    {
        System.out.println("Merit Campus");
    }
}
class MeritCampus
{
    public static void main(String[] args)
    {
        System.out.println("Merit Campus");
    }
}
class MeritCampus
{
    static public int main(String[] args)
    {
        System.out.println("Merit Campus");
        return 1;
    }
}
Both options A and B

Doubts

Problems

Topic: Java Program To Explain Public Static Void Main

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App