Frugal Testing interview question

Two JAVA Output based questions