Java Generic Method Return Wont Compile

I have a simple class like this: public class MyClass<T> { public T myMethod() { return this.returnObj(); } Object returnObj() {..} } The above return statement in myMethod wont compile, obviously because I am returning Ob...
more »

2017-06-17 00:06 (0) Answers

PHP Class called function has a return

Try to explain my problem, I hope someone give me an advice 'cause I'm stuck on that for a while. I've 2 functions in my simple class. This class send an email. First function is called send_mail(). Meanwhile I'm using phpmailer class. public func...
more »

2017-03-29 16:03 (0) Answers

Python Function- Return Value is 'not defined'

For my encryption code, I am trying to a return a value from one function because it is used in the next. I keep getting an error, telling me that the name 'cipher_text' is not defined. Please help! Error: (line 7) decryption (cipher_text, shift)...
more »

2017-03-15 07:03 (2) Answers

Stored procedure not returning value

I'm relatively new to both, c# and Oracle. I'm having a problem with Oracle stored procedure not returning a value back to my c# code. I've spent several days looking for a solution, trying everything I could find about this topic on the web. And I s...
more »

2017-02-22 13:02 (2) Answers

How do I cache the value?

I have an assignment in school. I want to write javascript code that calculets the fibonacci sequence. I think I have a solution for that (see code below) but now I want to save the previous value so when the function is called again, it donĀ“t have ...
more »

2017-01-10 00:01 (0) Answers

Return value of a function in C

I tried writing some code to check if the paranthesis in an expression are balances using the below function. Can someone help me understand why the below function is returning 1 in case of a balanced expression when it's not specified anywhere to re...
more »

2016-12-18 10:12 (3) Answers

auto vs auto&& for a function return value

Could you tell me please whether I am right that use of auto&& for a function return value is always a better choice than use of auto. For instance, in auto val = someObj.getVal(); the val will be a copy if getVal() returns a reference. Ho...
more »

2016-10-31 08:10 (1) Answers

Return value of initialize method

Can someone more versed in ruby than I please answer why the following returns nothing? class ThreeAndFive def initialize(low_number, high_number) @total = 0 (low_number..high_number).each do |number| if (number % 3 == 0 && n...
more »

2016-10-07 22:10 (3) Answers