Stroll stick time, see such a post. The boss fired a programmer who said he had just finished writing code. Why is that?

It turned out that the programmer had written code like this:

public static Date getNextDay() {

try {

Thread.sleep(24*60*60*1000);

} catch (InterruptrdException e) {

e.printStackTrace();

}

return new Date();

}

This code is supposed to get the date of the next day. The result is that the programmer wrote a function called sleep, which is used to delay the execution of the program. Sleep is used to pause for a certain amount of time and throw an interrupt exception that must be caught and handled before it can be used.

Then a group of bar friends came in and joked. “You’re a fucking genius, ha ha ha, how did you get into this company?”

“There is nothing wrong with it. One day of sleep is the next day.”

After looking at this code, have you ever done anything like this in your work?

Welcome to discuss and exchange.

Get the information to forward + comment private letter