Results 1 to 4 of 4

Thread: what are the possible return types of a main method?

  1. #1
    \"Dritan\" Guest

    what are the possible return types of a main method?

    I am an IT student , I a learning a bit of programming , bit I am not quite good at it , I have heard apart from the hard ware technicalities this forums also provides guidance in so for that reason I decided to take the support of your forum, so my question is regarding the main method of a program , I just wanted to as that how many and what type of data a main method can return iit does not matter of the language you are using , please tell me as I think I will not clear my exams if you do not provide me any sort of assistance.

  2. #2
    Join Date
    May 2009
    Posts
    543

    Re: what are the possible retyrun types of a main method?

    I the common format , where public is the access modifier , static specifies that it is not depending on any object , then comes the return type of the main method , it means that it is not returning any type of value. But in the programming languages like C and C++ you will be able to find return types in the main function as well, I think in that languages you may find int as a return type. You can try in the Turbo C or Borland tool. Internet issue.

  3. #3
    Join Date
    May 2009
    Posts
    539

    Re: what are the possible retyrun types of a main method?

    you do not return anything g, that will just be returning a null reference, as opposite to a reference to an instance t. Well I do not think that it is incorrect You just require to ensure that whoever is invoking this method , knows to test that the return value is not anything before trying to invoke a function or an instance , or it may even be the property of the method being invoked, so return type makes a lot of difference. a method or aproperty on the object.

  4. #4
    Join Date
    Dec 2010
    Posts
    37

    Re: what are the possible retyrun types of a main method?

    Java is a bit different form the C and C++ language Unlike those languages , the programmer does not need mention an error return code by giving from the main function . Instead they should make use of System.exit(code) inn order to accomplish this . If the Java main method returns any sort of value then in that case or scenario the default code of zero is returned.

Similar Threads

  1. Urgent Help with return method toString() Java!!
    By vizu in forum Software Development
    Replies: 3
    Last Post: 01-05-2011, 11:48 PM
  2. Method with multiple return types
    By ISAIAH in forum Software Development
    Replies: 5
    Last Post: 25-02-2010, 05:10 AM
  3. How to return value for void method?
    By Klaty in forum Software Development
    Replies: 5
    Last Post: 21-01-2010, 11:42 AM
  4. Method to return number of line
    By Vodka in forum Software Development
    Replies: 5
    Last Post: 13-01-2010, 02:48 PM
  5. Static types can we used as return type
    By ComPaCt in forum Software Development
    Replies: 2
    Last Post: 12-06-2009, 03:37 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,041,741.56459 seconds with 17 queries