Java Programming Language MCQ Java Exception MCQ

⚠ Report ✓ Question Verified Copy Link

Q: What will be the result after compiling this code?
class SuperClass{
      public int doIt(String str, Integer... data)throws Exception{
            String signature = "(String, Integer[])";
            System.out.println(str + " " + signature);
            return 1;
      }
}

public class Test extends SuperClass{
      public int doIt(String str, Integer... data){
            String signature = "(String, Integer[])";
            System.out.println("Overridden: " + str + " " +signature);
            return 0;
      }

      public static void main(String... args){
            SuperClass sb = new Test();
            sb.doIt("hello", 3);
      }
}
 

  • A Overridden: hello (String, Integer[])
  • B hello (String, Integer[])
  • C Compilation fails
  • D None of these
  • Share this MCQ

  • Aআরাফাত ময়দান
  • Bমুজদালিফা
  • Cমীনা
  • Dমসজিদে খায়েফ
  • Aফযল ইবনে আব্বাস রা. কে
  • Bআনাস ইবনে মালেক রা.কে
  • Cআব্দুল্লাহ ইবনে আব্বাস রা. কে
  • Dউসামা ইবনে যায়েদ রা.কে
  • Aসেটিই ছিল হজ্জে আকবর
  • Bজানা যায় না
  • Cনা
  • Dহ্যাঁ