• Register
1 vote
52 views

Problem:

I am totally new in programming language. So I tried to write a program using:
 public static void main(String args[])

But it seems to give error :

public static void main(String args[])
    ^
IndentationError: unexpected indent

What should I do?

10 7 2
6,060 points

Please log in or register to answer this question.

1 Answer

1 vote

Answer:

 public static void main(String args[])

Is not used in python.

Python's equivalent of "public static void main(String[] args) is:

import sys

def main(args):
    print args

if __**__ == '__**__':
    main(sys.argv)

** here represents any file name or any class or whatenver you have done. If you still dont understand ask me anything you want to know. 

Happy coding.

11 6 4
34,950 points

Related questions

0 votes
1 answer 8 views
8 views
Problem: How can you explain very well, to a beginner, the meaning of String args[] and the use of static in the following excerpt? class FirstApp { public static void main(String[] args) { ... } }
asked Apr 20 munim01 21k points
0 votes
1 answer 3 views
3 views
Problem: I was recently asked in an exam if public static void main(String arg[]) format of main method was fixed? Can we change it? Can we use main without any of public, static or void?
asked Apr 19 ummesalma 29.2k points
1 vote
1 answer 4 views
4 views
Problem: I am unable to find out the solution, Please solve it : public static void main string args
asked Mar 31 MUHAMMAD MUNEEB 83k points
1 vote
1 answer 4 views
4 views
Problem: Please help me to solve it out : public static void main(string args)
asked Mar 31 MUHAMMAD MUNEEB 83k points
1 vote
1 answer 3 views
3 views
Problem: Why I got the error : public static void main(string args) explain
asked Mar 31 MUHAMMAD MUNEEB 83k points
1 vote
1 answer 2 views
2 views
Problem: How can I deal with this problem : public static void main(string args) in java
asked Mar 31 MUHAMMAD MUNEEB 83k points
1 vote
1 answer 3 views
3 views
Problem: I need a help , How I can fix this : public static void main(string args) java
asked Mar 31 MUHAMMAD MUNEEB 83k points
1 vote
1 answer 5 views
5 views
Problem: How to fix this error : public static void main(string args) meaning
asked Mar 31 MUHAMMAD MUNEEB 83k points
1 vote
1 answer 6 views
6 views
Problem: Can anyone tell me the solution of this problem? public static void main(string args) meaning in java
asked Mar 31 MUHAMMAD MUNEEB 83k points
1 vote
1 answer 5 views
5 views
Problem: Any ideas on what I need to do to fix this? public static void main(string args) means
asked Mar 31 MUHAMMAD MUNEEB 83k points