Question

OOP IN JAVA !! 7 Which of the following access modifiers makes a field or method...

OOP IN JAVA !! 7

Which of the following access modifiers makes a field or method visible to all subclasses and classes within the same package but nowhere else?

A: private

B: static

C: public

D: protected

0 0
Add a comment Improve this question Transcribed image text
Answer #1

D: protected

Add a comment
Know the answer?
Add Answer to:
OOP IN JAVA !! 7 Which of the following access modifiers makes a field or method...
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
  • Question 1 1 pts Which of the following is not a valid class name in Java?...

    Question 1 1 pts Which of the following is not a valid class name in Java? O MyClass MyClass1 My_Class MyClass# Question 2 1 pts Which of the following statements is False about instance variables and methods? Instance variables are usually defined with private access modifier. Instance variables are defined inside instance methods. Instance methods are invoked on an object of the class that contains the methods. A class can have more than one instance variables and methods. Question 3...

  • 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....

  • a]using appropriate programming examples differentiate between cohesion and coupling[10marks] b]Write a java program that requests a...

    a]using appropriate programming examples differentiate between cohesion and coupling[10marks] b]Write a java program that requests a user to input 2 numbers then find the sum,difference and product of the inputed numbers [15marks] c]Public,Private,Protected ,static and final are access modifiers ,outline their individual effects when prepended to methods[15marks] d]Discuss the importance of the Exception class including examples of specific execeptions[10marks]

  • 1. Employees and overriding a class method The Java program (check below) utilizes a superclass named...

    1. Employees and overriding a class method The Java program (check below) utilizes a superclass named EmployeePerson (check below) and two derived classes, EmployeeManager (check below) and EmployeeStaff (check below), each of which extends the EmployeePerson class. The main program creates objects of type EmployeeManager and EmployeeStaff and prints those objects. Run the program, which prints manager data only using the EmployeePerson class' printInfo method. Modify the EmployeeStaff class to override the EmployeePerson class' printInfo method and print all the...

  • JAVA - Abstraction and Encapsulation are one pillar of OOP (Object Oriented Programming). Another is inheritance...

    JAVA - Abstraction and Encapsulation are one pillar of OOP (Object Oriented Programming). Another is inheritance and polymorphism. In this assignment we will use inheritance and polymorphism to solve a problem. Part (a) of the figure below shows a symbolic representation of an electric circuit called an amplifier. The input to the amplifier is the voltage vi and the output is the voltage vo. The output of an amplifier is proportional to the input. The constant of proportionality is called...

  • plz help me on this in java. QUESTION 28 Which modifiers can be applied to constructors?...

    plz help me on this in java. QUESTION 28 Which modifiers can be applied to constructors? (Choose all that apply) A. absract B. final C. native D. strictfp E. static F. synchronized G.transient H. volatile I. None of these

  • 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...

  • 1). The result of Java expression 5*7>3*(5+2) && 3*5-4<6 is ____ a. 35>35&&9<6 b. true &&...

    1). The result of Java expression 5*7>3*(5+2) && 3*5-4<6 is ____ a. 35>35&&9<6 b. true && false c. false d. False (2). You save text files containing Java language source code using the file extension___ a. .java b. .class c. .txt d. .src    (3). Which of the following is not a primitive data type in the Java programming language? a. boolean b. byte c. int d. Point (4). Given the Java statement int[][] vari = new int[5][7]; the value...

  • JAVA PROGRAM USING ECLIPSE. THE FIRST IMAGE IS THE INSTRUCTIONS, THE SECOND IS THE OUTPUT TEST...

    JAVA PROGRAM USING ECLIPSE. THE FIRST IMAGE IS THE INSTRUCTIONS, THE SECOND IS THE OUTPUT TEST CASES(WHAT IM TRYING TO PRODUCE) BELOW THOSE IMAGES ARE THE .JAVA FILES THAT I HAVE CREATED. THESE ARE GeometircObject.Java,Point.java, and Tester.Java. I just need help making the Rectangle.java and Rectangle2D.java classes. GeometricObject.Java: public abstract class GeometricObject { private String color = "white"; // shape color private boolean filled; // fill status protected GeometricObject() { // POST: default shape is unfilled blue this.color = "blue";...

  • Java -Create an interface and implement it In the murach.db package, create an interface named IProductDB....

    Java -Create an interface and implement it In the murach.db package, create an interface named IProductDB. This interface should specify this abstract method: public abstract Product get(String productCode); Modify the ProductDB class so it implements the IProductDB interface. Write the code for the new ‘get’ method. Then remove the getProductByCode method. In the Main class, modify the code so it works with the new ProductDB class. This code should create an instance of the IProductDB interface like this: IProductDB db...

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