What is the default modifier in Interface?

Answer Posted / ravikiran(aptech mumbai)

public+abstract for methods

public+abstract for interface declaration

public+static+final for the interface declaration variable

Is This Answer Correct ?    32 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to print 15 random numbers using foreach of java 8?

741


Can a class be declared as static?

888


How do you write a conditional statement?

707


What is a pattern what is an anti pattern?

709


What is Recursion Function?

877


Say you want to store the information about a number of pets in an array. Typical information that you could store for each pet (where relevant) would be • Breed of animal • Animal's name • Its birth date • Its sex • Whether it has been sterilised or not • When it is due for its next inoculation • When it last had its wings clipped For each type of pet (eg. dog, cat or bird) you would typically define a class to hold the relevant data. Note: You do not need to implement these classes. Just answer the following questions. 3.1.1 What would be the advantage of creating a superclass (eg. Pet) and declaring an array of Pet objects over simply using an array of Objects, storing each of the instances of the different pet classes (eg. Dog, Cat or Bird) in it? 3.1.2 Would you define Pet as a class or as an interface? Why? (2) (2)

1571


What is multithreading in java?

781


State one difference between a template class and class template.

843


Explain when we should make an instance variable private.

816


Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.

803


Is array size fixed in java?

741


What is widening and narrowing in java? Discuss with an example.

769


How can we make string upper case or lower case?

781


Explain treeset?

849


What happens if I remove static from main method?

760