Computer Science, asked by Aanchal133, 3 months ago

difference between return a; and return ; c in java​

Answers

Answered by Anonymous
1
  • return is not a function, but a statement. It is syntactically similar to other simple control flow statements like break and continue that don't use parentheses either. There is no difference. return is not a function call, but is a language statement.
Answered by pathankindhearted
1

Explanation:

function a() { return 1; }

function b() { return(1); }

I tested the above code in Chrome's console, and both returned 1.

function c() { return "1"; }

function d() { return("1"); }

I also tested the code above, and both of the functions returned "1".

Similar questions