Question

Question 1 If a method is marked as protected internal, who can access it? Classes that...

Question 1

If a method is marked as protected internal, who can access it?

Classes that are both in the same assembly and derived from the declaring class.
Only methods that are in the same class as the method in question.
Internal methods can only be called using reflection.
Classes within the same assembly, and classes derived from the declaring class

Question 2

To avoid having to use fully qualified referenced classes, you could:

Add a reference to the class.
Add an import statement for the class.
Add a using directive.
Inherit from the class.
Package the classes in the same solution.

Question 3

What is the .NET class that every other class is derived from?

System
System.Base
System.Object
System.Windows

Question 4


Interface can include:

data members
abstract methods
nonabstract methods
properties
all of the above

Question 5

Using the following declaration, which of the following statements is true?

public class aClass : bClass, IClass

IClass is an interface.
aClass is the derived class.
bClass is the base class.
all of the above
none of the above

Question 6

If two classes of the same name occur in two different namespaces and both namespaces are used (included) what must be done when using the classes?

Just use the name of the class. The C# compiler will figure out by the context which is the correct class to use
Provide a fully qualified path to the class that includes the name space and the name of the class.
Right click on the class name in the code and select the correct class from the popup menu that appears.
It is not possible to have two classes that are named the same thing in C#.

Question 7

If a method of a class is protected which of the following is true?

The method cannot be used.
The method can only be used on an instance of an object.
The method must be overridden to be used.
The method can only be accessed in the class or a subclass.

Question 8

For a method of a class to be overridden in a subclass which of the following must occur.

The method must be declared as virtual .
The method must be declared as public .
The method must be declared as do override .
The method must be static.

Question 9

In List what is the purpose of <T>   ?

To indicate the total number of items the list can hold.
To indicate the method that is used to manipulate the list.
To indicate the type of data the list can hold.
To indicate the time interval between garbage collections on the list.

Question 10

Abstract class can include :

Properties
Abstract methods
Non-abstract methods
All the above
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer)

1) Classes within the same assembly, and classes derived from the declaring class.

Only inherited members and those who are contained within the same assembly.

2) Add a using directive. The name space directive and alias directive.

3) System.Object. All the classes are derived from System.Object and inherits all its methods.

4) all of the above as it can contain data members, abstract methods properties etc.

Hope this answer helps. :) Happy to help.

Add a comment
Know the answer?
Add Answer to:
Question 1 If a method is marked as protected internal, who can access it? Classes that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In Java Which of the following statements declares Salaried as a subclass of payType? Public class...

    In Java Which of the following statements declares Salaried as a subclass of payType? Public class Salaried implements PayType Public class Salaried derivedFrom(payType) Public class PayType derives Salaried Public class Salaried extends PayType If a method in a subclass has the same signature as a method in the superclass, the subclass method overrides the superclass method. False True When a subclass overloads a superclass method………. Only the subclass method may be called with a subclass object Only the superclass method...

  • ********************Java Assigment******************************* 1. The following interface and classes have to do with the storage of information...

    ********************Java Assigment******************************* 1. The following interface and classes have to do with the storage of information that may appear on a mailing label. Design and implement each of the described classes below. public interface AddrLabelInterface { String getAttnName(); String getTitle(); // Mr., Mrs., etc. String getName(); String getNameSuffix(); // e.g., Jr., III String getProfessionalSuffix(); // O.D. (doctor of optometry) String getStreet(); String getSuiteNum(); String getCity(); String getState(); String getZipCode(); } Step 1 Create an abstract AddrLabel class that implements the...

  • PRG/421 Week One Analyze Assignment – Analyzing a Java™Program Containing Abstract and Derived Classes 1.    What is...

    PRG/421 Week One Analyze Assignment – Analyzing a Java™Program Containing Abstract and Derived Classes 1.    What is the output of the program as it is written? (Program begins on p. 2) 2. Why would a programmer choose to define a method in an abstract class (such as the Animal constructor method or the getName()method in the code example) vs. defining a method as abstract (such as the makeSound()method in the example)? /********************************************************************** *           Program:          PRG/421 Week 1 Analyze Assignment *           Purpose:         Analyze the coding for...

  • QUESTION 21 In the Java programming language method overriding occurs when (a) and precedes the call with an @Override...

    QUESTION 21 In the Java programming language method overriding occurs when (a) and precedes the call with an @Override annotation a method in a child class calls the method of the same name in one of its ancestor classes (b) when a class defines an abstract method and precedes the declaration with an @Override annotation two or more methods of a class have the same name but different signatures and both of (c) them are marked with an @Override annotation...

  • 44 A method signature defines which of the following? (choose all that apply) return type name...

    44 A method signature defines which of the following? (choose all that apply) return type name call parameters body 45 An abstract class can be implemented using the implements keyword. True False 46 An abstract class can be extended using the extends keyword. True False 47 Abstract classes are represented in UML by: italics underline plus/minus bold 48 An abstract class is a superclass for a subclass. True False 49 These symbols are used to denote an interface in a...

  • This is the question about object-oriend programming(java) please show the detail comment and prefect code of...

    This is the question about object-oriend programming(java) please show the detail comment and prefect code of each class, Thank you! This question contain 7 parts(questions) Question 1 Create a class a class Cat with the following UML diagram: (the "-" means private , "+" means public) +-----------------------------------+ | Cat | +-----------------------------------+ | - name: String | | - weight: double | +-----------------------------------+ | + Cat(String name, double weight) | | + getName(): String | | + getWeight(): double | |...

  • A Java Program Purpose:         Work with Abstract classes. Purpose:         Abstract classes are import because they ensure...

    A Java Program Purpose:         Work with Abstract classes. Purpose:         Abstract classes are import because they ensure than any children which inherit from it must implement certain methods. This is done to enforce consistency across many different classes. Problem:        Implement a class called Student. This class needs to be abstract and should contain a String for the name, and a String for the major (and they should be private). The class must have a constructor to set the name and major....

  • JAVA QUESTION 1 The value returned by a value-returning method can be saved for further calculation...

    JAVA QUESTION 1 The value returned by a value-returning method can be saved for further calculation in the program. True False QUESTION 2 To use a predefined method you must know the code in the body of the method. True False QUESTION 3 A formal parameter is a variable declared in the method heading (ie. it's signature). True False QUESTION 4 A local identifier is an identifier that is declared within a method or block and that is visible only...

  • JAVA Question 1 When implementing a method, use the class’s set and get methods to access...

    JAVA Question 1 When implementing a method, use the class’s set and get methods to access the class’s ________ data. a. public. b. private. c. protected. d. All of the above. Question 2 Set methods are also commonly called ________ methods and get methods are also commonly called ________ methods. a. query, mutator. b. accessor, mutator. c. mutator, accessor. d. query, accessor. Question 3 Composition is sometimes referred to as a(n) ________. a. is-a relationship b. has-a relationship c. many-to-one...

  • if we have following List classes: public class LinkedList<T> { class ListNode { protected T value;...

    if we have following List classes: public class LinkedList<T> { class ListNode { protected T value; protected ListNode next; public ListNode(T val, ListNode nxt) { value = val; next = nxt; } public ListNode(T val) { this(val, null); } public ListNode() { this(null, null); } } can you write the folowing methods in java: 1.Write a method for the LinkedList class called int indexOf(T val) which returns the integer index indicating the location of val in the list, or -1...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT