Tag: programming languages
Questions Related to programming languages
PROGRAM HELLO WRITE(,) 'Hello World' END PROGRAM
main() { cout << "Hello World!"; return 0; }
Find a character in a string. Choose the correct one.
Find character in string from the end. Choose the correct one.
Append character to string
Which of the following statements regarding threads is true?
You have created a TimeOut class as an extension of Thread, the purpose being to print a "Time's Up" message if the Thread is not interrupted within 10 seconds of being started. Here is the run method that you have coded. 1. public void run() 2. { 3. System.out.println("Start!"); 4. try 5. { 6. Thread.sleep(10000); 7. System.out.println("Time's Up!"); 8. } 9. catch(InterruptedException e) 10. { 11. System.out.println("Interrupted!"); 12. } 13. } Given that a program creates and starts a TimeOut object, which of the following statements is true?