Public class school public abstract double numberofstudent given the following piece of code
New Java 0 ratings0% found this document useful (0 votes) 86 views8 pagesDocument Informationclick to expand document information
hvjhgkjb Original Titlenew Java Copyright© © All Rights Reserved Available FormatsTXT, PDF, TXT or read online from Scribd Share this documentShare or Embed DocumentSharing Options
Did you find this document useful?0%0% found this document useful, Mark this document as useful 0%0% found this document not useful, Mark this document as not useful Is this content inappropriate?Download now SaveSave new Java For Later 0 ratings0% found this document useful (0 votes) New Java Original Title:new Java Uploaded byzcvv
hvjhgkjb SaveSave new Java For Later 0%0% found this document useful, Mark this document as useful 0%0% found this document not useful, Mark this document as not useful EmbedShare PrintDownload now Jump to Page You are on page 1of 8Search inside document You're Reading a Free Preview Reward Your CuriosityEverything you want to read. Anytime. Anywhere. Any device. No Commitment. Cancel anytime. Share this documentShare or Embed DocumentSharing Options
Home Books Audiobooks Documents 146 . Output : public class Test{ public static void main(String args[]){ int i = 1; do{ i--; }while(i > 2); System.out.println(i); } 147 . Output : int i = 10; while(i++ <= 10){ i++; } System.out.print(i); 148 . ____________ method cannot be overridden. Answer: B Explanation: final149 . Given the following piece of code: public class School{ public abstract double numberOfStudent(); } which of the following statements is true? Given the following piece of code:public class School{ public abstract double numberOfStudent();}which of the following statements is true? A). The keywords public and abstract cannot be used together. B). You must add a return statement in method numberOfStudent(). C). You must add a return statement in method numberOfStudent(). D). Class School must be defined abstract. 1 answersAnswered by Guest on 2021-05-30 12:11:44 | Votes 2 | Class School must be defined abstract. Join Telegram Group Answer This QuestionName:Email:Answer :Sum of (3+5)Submit:A. The keywords public and abstract cannot be used together. B. The method numberOfStudent() in class School must have a body. C. You must add a return statement in method numberOfStudent(). D. Class School must be defined abstract. Answer: Option D What is an abstract class write an example code?Abstract class: is a restricted class that cannot be used to create objects (to access it, it must be inherited from another class). Abstract method: can only be used in an abstract class, and it does not have a body. The body is provided by the subclass (inherited from).
Can abstract class have code?An abstract method will not have any code in the base class; the code will be added in its derived classes. The abstract method in the derived class should be implemented with the same access modifier, number and type of argument, and with the same return type as that of the base class.
What is an abstract class Mcq?Explanation: The condition for a class to be called abstract class is that it must have at least one pure virtual function. The keyword abstract must be used while defining abstract class in java. ADVERTISEMENT.
Can public and abstract be used together?Only public & abstract are permitted in combination to method. Example: public abstract void sum(); We use abstract keyword on method because Abstract methods do not specify a body.
|