Question

In: Computer Science

Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use...

Please, i need Unique answer, Use your own words (don't copy and paste).

*Please, don't use handwriting.

Please, i need Unique answer, Use your own words (don't copy and paste).

*Please, don't use handwriting.

Q1: Assume that there is a class named TestInterface that implements two interfaces A and B. Both the interfaces have a common method with the same signature (example int sampleMethod()). Explain how will the class define this method and how will the compiler identify, to which interface does this method belong to? Will the compiler give an error or will the program execute successfully. Give your code snippet to support your answer.

Please, i need Unique answer, Use your own words (don't copy and paste).

*Please, don't use handwriting.

Please, i need Unique answer, Use your own words (don't copy and paste).

*Please, don't use handwriting.

_______________________________________________

Q4:

  1. Mention the appropriate relationship between following classes: [0.5 Marks]
  1. HOD–StaffMember
  2. Car–Ferrari
  3. Student-Address
  4. BankAccount–FixedAccount
  5. House-Building
  6. Department-Teacher
  7. Traffic–TrafficSign

b.

  1. Provide the UML diagram for the following program.
 
               class Parent 
               {
                              public void getBike()
                               {
                                              System.out.println("Suzuki Bike");
                               }
               }
               class Child extends Parent 
               {
                              public void getCar()
                               {
                                              System.out.println("Swift car");
                               }
               }
               class inheritance 
               {
                               public static void main(String args[])
                               {
                                    Parent p = new Parent();
                                    p.getBike();
                                    Child c = new Child();
                                    c.getBike();
                                    c.getCar();
                               }

            }

Please, i need Unique answer, Use your own words (don't copy and paste).

*Please, don't use handwriting.

Please, i need Unique answer, Use your own words (don't copy and paste).

*Please, don't use handwriting.

Solutions

Expert Solution

Q.1

Solution for the above:

public class HelloWorld {

public static void main(String[]args){

TestClass test=new TestClass();

test.diplay();

}

}

interface TestInterface{

void display();

}

interface|1 extends TestInterface{

@Override

void display();

}

interface|2 extends TestInterface{

}

class TestClass implements|1,|2{

@Override

pulic void display(){

sytem.out.printIn('Yes");

}

}

so this is the code given according to the problem.

-first interface i have overrriden the class but in other i have not done.

-make sure that if an interface extends another interface it is not required to override the methods.

-the methods are overrriden in all the interface. complier will not give error.

now, lets see the code for the requirement:

public class HellowWorld{

public static void main(string[]args){

TestClass test=new TestClass();

test.display();

}

}

interface TestInterface{

void display();

}

interface|1extends TestInterface{

@overrride

void display();

}

interface|2 extends TestInterface{

@override

void display();

}

class TestClass implements |1,|2{

@overrride

public void display(){system.out.printIn("Yes");

}

}


Related Solutions

Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use...
Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use handwriting. *Please, don't use handwriting.*Please, don't use handwriting.*Please, don't use handwriting.*Please, don't use handwriting.*Please, don't use handwriting.*Please, don't use handwriting.*Please, don't use handwriting.*Please, don't use handwriting.*Please, don't use handwriting.*Please, don't use handwriting.*Please, don't use handwriting.*Please, don't use handwriting.*Please, don't use handwriting. _______________ Solve the following questions Q1 Construct a cumulative frequency distribution of the 20 brain volumes(cm3) listed below. Use the classes 900-999, 1000-1099,...
Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use...
Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use handwriting. *Please, don't use handwriting.* *Please, don't use handwriting. *Please, don't use handwriting.**Please, don't use handwriting. *Please, don't use handwriting.**Please, don't use handwriting. *Please, don't use handwriting.* * i need References URL Link pleasssse help me i need the answer Critically appraise the following cross-sectional study given in the link below: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5989365/ Discuss the strength and limitations of the study in a brief manner...
Please, i need Unique answer, Use your own words (don't copy and paste). Please, don't use...
Please, i need Unique answer, Use your own words (don't copy and paste). Please, don't use handwriting, Use your keyboard. Q. 2. In present scenario, the importance of microeconomics is increasing day by day, in your          Opinion, what are the three ways that we can use macroeconomic analysis.
Please, i need Unique answer, Use your own words (don't copy and paste). Please, don't use...
Please, i need Unique answer, Use your own words (don't copy and paste). Please, don't use handwriting, Use your keyboard. Q. 3. When the whole sector of the market is occupied by the little number of big corporations who share the leadership, what do we call this type of market structure? Explain in details the benefits for the leading company and disadvantage of such situation on final consumers.
Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use...
Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use handwriting. Suppose you are assigned a task of designing user interface for a web application to get students' feedback about sports facilities provided at the campus. The application is composed of data entry forms with menus and dialog boxes. Having, as goals, speeding up students’ data entry and reducing errors, please tell which six major menu design concerns you will keep in mind during...
Please, i need Unique answer, Use your own words (don't copy and paste). Please, don't use...
Please, i need Unique answer, Use your own words (don't copy and paste). Please, don't use handwriting, Use your keyboard. Q1. Discuss in your words the purpose of a bank reconciliation. (1 point) Q2. Prepare general journal entries for the following transactions of this company for the current year: (2 points). Apr. 25 Sold SAR 4,500 of merchandise to CBC Corp., receiving a 10%, 60-day, SAR 4,500 note receivable. June 24 The note of CBC Corp., received on April 25...
Please, i need Unique answer, Use your own words (don't copy and paste). Please, don't use...
Please, i need Unique answer, Use your own words (don't copy and paste). Please, don't use handwriting, Use your keyboard.    Q3. Choose two accounting assumptions and explain in your word.   
Please, i need Unique answer, Use your own words (don't copy and paste). Please, don't use...
Please, i need Unique answer, Use your own words (don't copy and paste). Please, don't use handwriting, Use your keyboard. Q. 1. Provide an example of any two leading companies from the same industry, which are competing directly for market share. Give a short profile. Q. 2. Suppose, if you are the manager of one of these companies, what pricing policy will you adopt to be in the first position? Why? Q. 3. When the whole sector of the market...
Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use...
Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use handwriting. Complete the following table related to the CIA triad. Confidentiality Integrity Availability Definition Example of business situation leading to a loss of Example of threat to
Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use...
Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use handwriting. DDoS attack Based on the Internet, access to the article intituled: ‘A survey on DDoS attack and defense strategies from traditional schemas to current techniques’. 1- Describe the DDoS attack. 2- Provide at least two exploited vulnerabilities used by hacker to perform the DDoS attack. 3- Provide at least two countermeasures against DDoS.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT