Computing desk | ||
---|---|---|
< January 23 | << Dec | January | Feb >> | January 25 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
Try SOMETHING, If you catch SOMETHING_ELSE (success) than continue, If you didn't catch SOMETHING_ELSE (bug), Either, Do nothing || throw an exception (error)
Thanks, 79.176.222.75 ( talk) 00:59, 24 January 2022 (UTC)
try { /* This is the code we're trying to execute. If all goes well no exception is thrown and this code runs to completion. */ } catch { /* An exception happened in the above code and it didn't run to completion. Deal with the exception here. */ } finally { /* This code is always executed regardless of what happened above. */ }
Try SOMETHING, If you succeed Either Do nothing || Do what's described in the catch block (which isn't throwing an exception) If you fail Either Do nothing || Throw an exception (error)
Try SOMETHING If you succeed Do nothing If you fail Do what's described in the catch block Do what's described in the finally block anyway
JIP | Talk 02:30, 24 January 2022 (UTC)
I have a question about Git. Suppose I'm in branch A and I create a new branch B from it. There's a file called X in branch A which now also is in branch B.
I now switch back to branch A and remove file X from there. This does not affect branch B. Later, I switch back to branch B and make some edits to file X there.
Now when I switch back to branch A again and merge branch B to it, will the merge bring the file X back to branch A or does Git realise that since I removed the file from there, it really shouldn't be there? JIP | Talk 11:39, 24 January 2022 (UTC)
Computing desk | ||
---|---|---|
< January 23 | << Dec | January | Feb >> | January 25 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
Try SOMETHING, If you catch SOMETHING_ELSE (success) than continue, If you didn't catch SOMETHING_ELSE (bug), Either, Do nothing || throw an exception (error)
Thanks, 79.176.222.75 ( talk) 00:59, 24 January 2022 (UTC)
try { /* This is the code we're trying to execute. If all goes well no exception is thrown and this code runs to completion. */ } catch { /* An exception happened in the above code and it didn't run to completion. Deal with the exception here. */ } finally { /* This code is always executed regardless of what happened above. */ }
Try SOMETHING, If you succeed Either Do nothing || Do what's described in the catch block (which isn't throwing an exception) If you fail Either Do nothing || Throw an exception (error)
Try SOMETHING If you succeed Do nothing If you fail Do what's described in the catch block Do what's described in the finally block anyway
JIP | Talk 02:30, 24 January 2022 (UTC)
I have a question about Git. Suppose I'm in branch A and I create a new branch B from it. There's a file called X in branch A which now also is in branch B.
I now switch back to branch A and remove file X from there. This does not affect branch B. Later, I switch back to branch B and make some edits to file X there.
Now when I switch back to branch A again and merge branch B to it, will the merge bring the file X back to branch A or does Git realise that since I removed the file from there, it really shouldn't be there? JIP | Talk 11:39, 24 January 2022 (UTC)