Which declaration of the main method below would allow a class to be started as a standalone program. Select the one correct answer.

public static int main(char args[])
public static void main(String args[])
public static void MAIN(String args[])
public static void main(String args)
public static void main(char args[])

WHAT IS THE answer ?

sourabh_8 commented: public static void main (char args []) +0

Recommended Answers

All 3 Replies

what is your guess? if you don't know the answer to this, you are clearly not ready to take the exam.
take a look at the sticky threads that are meant to help beginning programmers.

commented: public static void main (String args[]) +0

the correct on which matches with the signature of the one defined was...
2.public static void main(String args[])
otherwise remaining will complile but not execute...

public static void main (char args[])

commented: wrong. main needs an array of Strings -3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.