MCQs > IT & Programming > JSharp - J# > What will be the output when the following code is compiled and run?

abstract class Search {
  public Search() { }
  
  public abstract void Result();
}

public class SearchMain extends Search {
  
  public SearchMain() { }
  
  public int Result() {
    System.out.println('I am Result()');
    return 1;
  }

  public static void main(String str[]) {
    new SearchMain().Result();
  }    
}

JSharp - J# MCQs

What will be the output when the following code is compiled and run?

abstract class Search {
  public Search() { }
  
  public abstract void Result();
}

public class SearchMain extends Search {
  
  public SearchMain() { }
  
  public int Result() {
    System.out.println("I am Result()");
    return 1;
  }

  public static void main(String str[]) {
    new SearchMain().Result();
  }    
}

Answer

Correct Answer: The code will fail to compile

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JSharp - J# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

More JSharp - J# MCQ Questions

search

JSharp - J# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it