1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ilya [14]
3 years ago
6

. Why should we favor programming to interfaces over implementations?

Computers and Technology
1 answer:
xenn [34]3 years ago
4 0

Answer:

Interfaces are way to use full abstraction.That;s why it is preffered over implementations.

Interfaces are just like class.But the methods declared inside an abstract class are by default abstract and the variables are by default static,final.Which is not the case with classes in classes the variables can be static or non- static ,fincal or non-final and methods can be abstract or non-abstract.

Java classes does not support multiple inheritance but interfaces support multiple inheritance.So whenever we want to implement multiple inheritance in Java we use interfaces.

You might be interested in
write a program that computes an integer's checksum. to compute the checksum, break the integer into its constituent
Serggg [28]

Using the knowledge in computational language in python it is possible to write a code that computes an integer's checksum.

<h3>Writting the code:</h3>

<em>def checkSum(n):                    # Function definition</em>

<em>    total = 0                       # total variable which returns sum</em>

<em>    c = 0                           # counter variable which count the even position</em>

<em>    while(n!=0):                    # running a loop while n != 0</em>

<em>        r = int(n%10)               #breaking the number into digits</em>

<em>        c=c+1                       # increase counter</em>

<em>        if c%2==0:                  # if counter is even position then double the number </em>

<em>            r = r*2</em>

<em>            while(r!=0):                            # do the process</em>

<em>                total = total + int(r%10)</em>

<em>                r = int(r/10)</em>

<em>            n=int(n/10)    </em>

<em>        else:                       # if counter is odd position then simple add the digit </em>

<em>            total = total + r       # into total</em>

<em>            n=int(n/10)</em>

<em>    return total                    # in the last return the sum of digits</em>

<em># Driver code</em>

<em>n = int(input("Enter Number:"))         # asking user to enter the number </em>

<em>print(checkSum(n))                      # calling the function</em>

See more about python at brainly.com/question/18502436

#SPJ1

8 0
1 year ago
What is the duty of WHH? (white hat hackers)<br><br><br>ANY WHH HERE?<br>​
Minchanka [31]
White hat hackers use their capabilities to uncover security failings to help safeguard organizations from dangerous hackers. They can sometimes be paid employees or contractors working for companies as security specialists who attempt to find gaps in security.
6 0
2 years ago
Find and record a set of instructions containing a repetition clause (e.g., instructions on a shampoo bottle, a recipe, etc.). H
Leto [7]

This question belongs to scratch programming. This programming language has various instructions to carry out various tasks. There are different types of repeat statement available. This statement or instruction allows the user / programmer to repeat certain line of statements to a number of times. Here, according to the question, we need to use “Repeat after me”

If you take a music note, the tempo, timing and pitch needs to be mentioned clearly and “:” represents that a particular note to be repeated only once.

3 0
3 years ago
What is the purpose of "display:table"?
igor_vitrenko [27]

Answer:

Modern browsers use CSS to style all their markup.

How would they render a <table> element if CSS had nothing that could express the appearance of one?

(That, and you might have non-tabular data that you want to render like a table, there are enough people using tables for layout to see a demand for it).

They can be used to format content in a tabular manner when the markup does not use the table element, e.g. because the markup was written by someone who was told not use tables or because the markup is generic XML and not HTML.

You can also design a page using e.g. div elements so that some stylesheet formats them as a table, some other stylesheet lets them be block elements or turns them to inline elements. This may depend e.g. on the device width

5 0
3 years ago
Your first submission for the CIS 210 Course Project should include the following functionality: - Requests the user to input hi
Viefleur [7K]

Answer:

In Java:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 String name;

 System.out.print("First name: ");

 name = input.next();

 name= name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase();

 System.out.print(name);

}

}

Explanation:

This declares name as string

 String name;

This prompts the user for first name

 System.out.print("First name: ");

This gets the name from the user

 name = input.next();

This capitalizes the first letter of name and makes the other letters to be in lowercase

 name= name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase();

This prints the formatted name

 System.out.print(name);

5 0
3 years ago
Other questions:
  • You have to communicate a signal in a language that has 3 symbols A, B and C. The probability of observing A is 50% while that o
    11·1 answer
  • Please I need all the help I can get Thank You So Much
    14·1 answer
  • WILL GIVE BRANLYIST
    6·1 answer
  • What is the radix transformation method?
    5·1 answer
  • - Explain the Windows User Authentication process for Client connecting to the domain
    11·1 answer
  • What is not true about contracts?
    12·2 answers
  • What do you think about the future of computers?​
    14·1 answer
  • In paragraph form, explain and describe at least three common situations in which you would yield the right-of-way.
    5·1 answer
  • In which situation would saving a Word document as a PDF be most useful?
    9·2 answers
  • Simple example of hybrid computer​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!