Question #2349971

How do I go about this method?

public Mys sub(int start, int end) { Mys index = MyString; return Mys; } How do I go about getting this to compile? I should return Mys, yet it is always telling me incompatible types. I tried returning a string and int and I get incompatible types. I don't understand how to make a variable with Mys. Thanks. I don't need anything in the method right now other than it compiling. I think I might have gotten it, now just want to check if I'm doing it right. I said Mys a = new Mys; and I used return a; It is compiling now, so I guess the return statement works, so is this the proper way to do it? Thanks.

2012-12-05 09:19:31

TELL US , if you have any answer

There is NEVER a problem, ONLY a challange!

The helpinganswers.com is a free-to-use knowledgebase.
  The helpinganswers.com was started on: 02.07.2010.
  It's free to register. Once you are a registered user, you can ask questions, or answer them.
  (Unless registration you can just answer the questions anonymously)
  Only english!!! Questions and answers in other languages will be deleted!!

Cheers: the PixelFighters

  Contact: support@helpinganswers.com

C'mon... follow us!

Made by, history, ect.