How to reduce protected accessor to package accessor in child class

I have made one abstract class ( say Parent), with 2 abstract methods (am1() & am2()) , with protected accessors. A class extends parent class (say Child). Now Child class need to keep accessors type of protected method as protected, as we cannot reduce the scope. Now as per my design, I need to create many subsclass (say SubClass) of Child class. But I don't want subclass of Child class to have access of method am1() & am2(). SubClass is declared in different package. But as I cannot reduce the accessor type from protected to package, I am not able to restrict the access of am1() & am2() to Child class and SubClass should not able to access am1() & am2().
Do we have some way to design above scenario?
Thanks in advance
Praveen

You can't reduce visibility.
A subclass is supposed to be able to do everything the superclass can. If you'd restrict visibility of certain methods or fields, you break that contract.

Similar Messages

  • Why we cannot reduce protected accessor to package accessor in child class?

    Hi,
    I have made one abstract class ( say Parent), with 2 abstract methods (am1() & am2()) , with protected accessors. A class extends parent class (say Child). Now Child class need to keep accessors type of protected method as protected, as we cannot reduce the scope. Now as per my design, I need to create many subsclass (say SubClass) of Child class. But I don't want subclass of Child class to have access of method am1() & am2(). SubClass is declared in different package. But as I cannot reduce the accessor type from protected to package, I am not able to restrict the access of am1() & am2() to Child class and SubClass should not able to access am1() & am2().
    Do we have some way to design above scenario?

    Double Post:
    http://forum.java.sun.com/thread.jspa?threadID=634969
    Triple post actually.
    http://forum.java.sun.com/thread.jspa?threadID=634985
    http://forum.java.sun.com/thread.jspa?threadID=634969

  • Update New Records is taking much time to complete. How to reduce

    Hi,
    Iam having a Table with 200 Clumns and trying to Update 5 columns and the table has 5lakh Records. It is taking very much time 2hours to complete. Pls let me know why is this taking time how to reduce....
    In my ssis Package iam using
    Oracle Source
    Look up
    Oledb Command for the Update.
    Please help ism stuck?

    I have somthing like this..
    Update table
    Set column1 =@column1, column2=@column2,column3=@column3,column4=@column4,column5=@column5
    where column1=@column1
    in this case i need to add a index on column1 right? Pls llet me know
    Yes, an index in column1 (preferably clustered) would avoid the table scan for each update. The ELT the staging table alternative Jim suggested will likely perform better than individual updates for a large process like this.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • How can reduce PO re-schedule in recommendations in ASCP

    How can reduce PO re-schedule in recommendations in ASCP.
    Presently we are in un-constraint plan and run ASCP plan weekly. Lot of re-schedule recommendation come in ASCP our supplier was confused they are unable to respond as weekly change in need by date.
    Please suggest How can reduce PO re-schedule recommendations?
    My E-mail ID is [email protected]
    regards
    Mukeshb
    Edited by: user9081379 on Aug 11, 2012 3:57 AM

    Hi,
    You can use Planning time fence (PTF) to reduce the nervousness in your system. Having a reasonable PTF (item-org level) will ensure that there are no sudden changes in the plan - hence lesser re-schedules.
    Also, use order modifiers, if possible.
    Hope this helps.
    Thanks,
    Devesh A.

  • How to reduce Oracle Cluster Time Synchronization time to 0

    Hi Guys,
    How to reduce Offset (in msec) of Oracle Cluster Time Synchronization time to 0 ???
    is there any command or is it the only solution to wait to become 0 slowly...
    [root@caslive bin]# ./crsctl check ctss
    CRS-4701: The Cluster Time Synchronization Service is in Active mode.
    CRS-4702: Offset (in msec): -1300
    regards,
    manish
    Email ID: [email protected]

    Hi,
    1.From DB02--> detail analysis menu you can take out top 50 tables & indexes. you can mark the size of the index should be generally less than the table.If its more or very much similar size of table, you can rebuild it using SE14. This can free some space.
    or else you may use brspace to do this.
    http://help.sap.com/saphelp_nw70/helpdata/EN/58/6bec38c9fa7e44b7f2163905863575/frameset.htm
    In case of table this option is risky as it may result in data loss.
    2. Earlywatch alert gives the top 20 degenrated index. you can check that which also gives a factor 'storage quality'.
    3. Run report SAP_DROP_TMPTABLES. It removes temporary database objects. ( we do this in our BW system)
    Hope this helps
    Thanks
    Sushil

  • How to reduce an illustrator file to 25 percent without losing quality?

    I have created a graphic image at full size. The graphic company has requested the file to be reduced to 25% to allow uploading. I have no idea how to reduce the entire image while keeping it an illustrator file. I am also worried about losing the quality once it is expanded to 100%.

    The file I have created is at full scale it is 186 inches by 152 inches. It
    contains other things such as text and smaller images on top of the file. I
    would like to keep all of the proportions but I am needing to scale my file
    down to 25 percent of the original image. The graphic company requests this
    and they plan to open it and rescale it to 100 percent. I am also worried
    about losing quality when they rescale this photo. Am I making sense?
    Megan B. Pierce
    Photographer, Magic Kingdom, Disney College Program
    Southeastern Louisiana University 2014
    On Sun, Jan 25, 2015 at 2:03 PM, Monika Gause <[email protected]>

  • Class Visibility of Protected Members between Packages

    Hi,
    I'm developing a system that consists of package A, which in turn contains packages B and C. My database access class is in a package by itself (package A.B) and I want anyone who uses it to provide a username and password. In order to do this, my system has a class called Config.java which resides in package A. When Config.java is instantiated, it will read the contents of some configuration xml file on the system and set protected variables for the username and password.
    My problem is the following:
    1. Config.java is not visible to any other classes in other packages unless it is public
    2. If Config.java is made public, then anyone can inherit from it and have access to its protected members.
    3. The other classes (in package A.C) must have access to the username and password in order to supply it to the database access class.
    How can I get around this?
    Thanks,
    Ama

    What is your concern, what someone will hack your
    database by deriving
    from Config?
    Is that a reasonable fear -- couldn't they just look
    in the XML file you mention?Well, hopefully that xml wont be so accessible, I'm thinking it will be necessary in case the user wants to modify any database settings through the application configuration screens.
    I guess what my question is really, is where would a large application that needs to access a database usually store the username and password information? Surely it cant be hardcoded in the application somewhere? What if the user wants to change the connection info?

  • How does Azure protect me from SQLi and malicious insiders?

    Im writing a thesis on cloud security and I was wondering if someone with knowledge could tell me how Azure protects my application from SQLi. And also how they reduce the risk of Malicious insiders, not only by policy but also by technical implementations.

    As I understand it, Azure doesn't provide any additional protections against things like SQL Injection than you'd have if you hosted the SQL server yourself.
    SQL Injection relates more to the code being run in conjunction with the database, either through the code you write in your stored procedures, or the code written in your application which then calls SQL for it's data. Protecting against SQL Injection is
    done at this level, not at the base SQL level, so Azure doesn't make a difference.
    Things like not sanitising the information inputted to your application puts you at risk, eg ensuring that when someone enters their name on a website form that it really is just a name (so no special characters, no single quotes etc) before passing that
    information to SQL.
    In terms of malicious insiders, well Azure does provide protection in terms of firewall restrictions etc, but that's realistically no different to if you had your own SQL server sitting in front of a firewall. In the same way as you would with your own dedicated
    SQL server, if you grant users permission to access the database then there's no way to prevent them from doing what they want.

  • How can I protect my data in numbers from unintentional user of my iPad by other family members? In other words, how can I password protect my numbers and other apps from apple computer company?

    I have other members of my family use my iPad for educational/recreational use, young children who may want to play kid games. I don't want them to accdently get into my data stored in the three business apps from apple. I would like to password protect these files.
    I would also like to log out of the email systems that I use, so some one else can use this device to access their own emails. By leaving my accounts open al the time, is really asking for trouble from a host of sources.
    I can't believe that the iPad is not designed to protect the privacy and data from prying eyes ... Un intuitional as it may be.
    Please fix this issue so I create my info on this device and enjoy it fully. Or tell me how I can protect my data.
    Thnax.

    Thanx for your response. Any data stored anywhere should be able to be protected from stealing, malicious destruction or unintentional destruction. Theo ad an be stolen and without any kind ofpassword protection, the thief could get into your sensitive data.
    If Apple wants iPad to become a business tool that can be used with ideas, thots, data protected, then Apple needs to provide this protection to it's customers. Now it's unto the users to use it or not.
    I know iPad is being considered to be used by doctors, and can u imagine the confidentiality requirements of HIPPA rules... It will make this device not usable without data protection. I am sureweall have heard about hacking going on at all levels. It's surprising that this device's software is left unprotected.
    My iPad may be sitting on my desk and my 3 year old grand daughter would pick it up and start "playing" with it. That means I can't store anything on this machine that may possibly be changed.
    I have discussed this with specialists in apple stores, and those who have been around info technology understand my concerns and they may forward this request further up. They do not have the answer for it..... So far.
    I think data security should be everyone's concern... Be it a one person device or multiple user device.
    I hope that some responsible people at Apple would read this and provide the protection that will make this device lot more acceptable in the business world.

  • I have a document that in Word required a password to open. I copied and pasted it to Pages. Put the password protection on. Now if I click on that filename in Finder it automatically opens.Why. Anyone can read it. How do I protect it again?

    I have a document that in Word required a password to open. I copied and pasted it to Pages. Put the password protection on. Now if I click on that filename in Finder it automatically opens.Why. Anyone can read it. How do i protect it again?

    You saved it after setting the Password? :
    Inspector > Document > Document > Require Password to Open
    I just tested it and it shows up ijn The Finder with a padlock on the file icon and does require a password to open.
    Peter

  • I love Apple and I use all product. iPhone 3,3s,4,4s,5, iPad and Mac Air(now no more 3,3s and 4)... Only one thing I want to know is... What can I do if some one spy on my phone? How do I protect all my stuff that I put in my phone?

    I love Apple and I use all product. iPhone 3,3s,4,4s,5, iPad and Mac Air(now no more 3,3s and 4)... Only one thing I want to know is... What can I do if some one spy on my phone? How do I protect all my stuff that I put in my phone?

    the only way that anyone would be able to see anything at all on your phone is if they knew your apple id password, or they were looking over your shoulder
    if you are concerned that someone may know your apple id password, please change it at appleid.apple.com

  • How can i protect J2EE applications from piracy?

    I m looking for solution to protect Web application from piracy.
    I want my application run on web server for which it is built, &
    it musn't run on any other web server.
    how can i protect my web application from piracy?.
    Our .Net applications we protect using Hardware ID binding ,
    How can i protect J2EE applications?

    How is it going to get anywhere else? What's the threat model here? and what's the real, not imaginary, cost to you of the threat succeeding? and can you price your product such that it's cheaper to buy it than to pirate it?
    The answers to this question probably aren't in the field of tricky code or cryptography. They're more likely in marketing, time-to-market, pricing, and in physical security of the server, ...

  • How to reduce memory use on my iMac

    How to reduce memory use on my iMac, OS X Yosemite, 2.7 GHz Intel Core i5
    8 GB memory
    Running very slowly, and the little spinning ball showing up.
    How do I clean up my IMac please?
    Should I use MacKeep or any clean up apps?

    When you see a beachball cursor or the slowness is especially bad, note the exact time: hour, minute, second.  
    These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    Each message in the log begins with the date and time when it was entered. Scroll back to the time you noted above.
    Select the messages entered from then until the end of the episode, or until they start to repeat, whichever comes first.
    Copy the messages to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of it useless for solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • How can i protect my iphone from virus

    How can i protect my iphone from virus plz gelp me

    Don't jailbreak it.
    As long as you do not hack it, then you have nothing to fear.

  • Due to virus attack i had to format my windows laptop...now when i installed new itunes software i had to sync my ipod touch again but it says that if do the same then the data on my ipod touch will be erased....how should i protect my ipod touch data?

    due to the virus attack i had to format my windows laptop...now when i installed new itunes software i had to sync my ipod touch again but it says that if i do it then the data present on my ipod touch will be erased as it is syncd to some older library... how should i protect my ipod touch data?

    With all you media (apps, music) in the iTunes library connect the iPod to the computer and make a backup. Do that by right clicking on the iPod under Devices in iTunes and select Back Up. Then restore the iPod from that backup.
    Note the the iPod backup that iTunes makes does not included synced media like apps and music.

Maybe you are looking for