Java

Java Tricky Question – Display "Hello" before main method



This is a tricky question often asked in interviews. You have to display “Hello” and “Bye” in separate lines. Seems too easy right? But there is a twist. The first line under the main method must be System.out.println(“Bye”);
#JavaInterviewQuestions
#JavaTrickyQuestions

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *