SCJP Practice Question

I'm working through the McGraw Hill SCJP study guide for Java 5, and I don't much care for the following question:
(page 159)
5. Select the two statements that best indicate a situation whit low coupling. (Choose two.)
A. The attributes of the class are all private.
B. The class refers to a small number of other objects.
C. The object contains only a small number of variables.
D. The object is referred to using an anonymous variable, not directly.
E. The reference variable is declared for an interface type, not a class. The interface provides a small number of methods.
F. It is unlikely that changes made to one class will require any changes in another.
Answer:
E and F are correct. Only having access to a small number of methods implies limited coupling. If the access is via a reference of interface type, it may be argued that there is even less opportunity for coupling as the class type itself is not visible. Stating that changes in one part of a program are unlikely to cause consequences in another part is really the essence of low coupling. There is no such thing as an anonymous variable. Referring to only a small number of other objects might imply low coupling, but if each object has many methods, and all are used, then coupling is high. Variables (attributes) in a class should usually be private, but this describes encapsulation, rather than low coupling. Of course, good encapsulation tends to reduce coupling as a consequence.
I would have thought A and E were the answers here. If the attributes of a class are all private, you're going to have to use accessors and mutators to get to them, which is a prime example of loosely coupled code. I disagree that "F. It is unlikely that changes made to one class will require any changes in another." is a proper answer because although it does cut right to the heart of the matter, it does not describe the mechanism through which this feat has been accomplished and leads me to believe that perhaps the class has been designed with likely future changes in mind such that they will have a low impact but other unforseen changes may cause problems.
Am I out of line here?
If so, please enlighten me!
If not, ... yarrrgh! If there are questions like this on the exam, I expect to have problems with them. Any suggestions? How can I get my reasoning to line up with the test, at least for the day of the exam? ;)
Thank you in advance for any assistance!

I think you're making a general mistake you have to come to terms with before you attempt the exam. You're reading stuff into the statements that aren't there. You must learn to consider the statements just as they stand and don't modify them in your mind.
For example,
If the attributes of a class are all
private, you're going to have to use accessors and
mutators to get to them,That's not what the statement says. It says all attributes are private, nothing else.
it does cut right to the heart of the
matter, it does not describe the mechanism through
which this feat has been accomplishedWho said mechanisms must be provided? The statement cuts right to the heart of the matter as it stands.

Similar Messages

  • Best Practices Question: How to send error message to SSHR web page.

    Best Practices Question: How to send error message to SSHR web page from custom PL\SQL procedure called by SSHR workflow.
    For the Manager Self-Service application we’ve copied various workflows which were modified to meet business needs. Part of this exercise was creating custom PL\SQL Package Procedures that would gather details on the WF using them on custom notification sent by the WF.
    What I’m looking for is if/when the PL\SQL procedure errors, how does one send an failure message back and display it on the SS Page?
    Writing information into a log or table at the database level works for trouble-shooting, but we’re looking for something that will provide the end-user with an intelligent message that the workflow has failed.
    Thanks ahead of time for your responses.
    Rich

    We have implemented the same kind of requirement long back.
    We have defined our PL/SQL procedures with two OUT parameters
    1) Result Type (S:Success, E:Error)
    2) Result Message
    In the PL/SQL procedure we always use below construct when we want to raise any message
    hr_utility.set_message(APPL_NO, 'FND_MESSAGE_NAME');
    hr_utility.raise_error;
    In Exception block we write below( in successful case we just set the p_result_flag := 'S';)
    EXCEPTION
    WHEN APP_EXCEPTION.APPLICATION_EXCEPTION THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    WHEN OTHERS THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    fnd_message.set_name('PER','FFU10_GENERAL_ORACLE_ERROR');
    fnd_message.set_token('2',substr(sqlerrm,1,200));
    fnd_msg_pub.add;
    p_result_message := fnd_msg_pub.get_detail;
    After executing the PL/SQL in java
    We have written some thing similar to
    orclStmt.execute();
    OAExceptionUtils.checkErrors (txn);
    String resultFlag = orclStmt.getString(provide the resultflag bind no);
    if ("E".equalsIgnoreCase(resultFlag)){
    String resultMessage = orclStmt.getString(provide the resultMessage bind no);
    orclStmt.close();
    throw new OAException(resultMessage, OAException.ERROR);
    It safely shows the message to the user with all the data in the page.
    We have been using this construct for a long time for all our projects. They are all working as expected.
    Regards,
    Peddi.

  • Oracle Asset (Functional) Practice Questions for Interviews and Exam

    https://www.createspace.com/3495382
    http://www.amazon.com/Functional-Questions-Interviews-Certification-Examination/dp/1456311581/ref=sr_1_4?ie=UTF8&s=books&qid=1289178586&sr=8-4
    List Price: $29.99
    Add to Cart
    Oracle Asset (Functional) Practice Questions for Interviews and Certification Examination (Release 11i and 12)
    Functional Consultant
    Authored by Erp Gold
    This book contains 150 Oracle Asset Practice Questions for functional consultants. Very useful for interviews and certification examinations.
    Publication Date:
    Oct 26 2010
    ISBN/EAN13:
    1456311581 / 9781456311582
    Page Count:
    94
    Binding Type:
    US Trade Paper
    Trim Size:
    6" x 9"
    Language:
    English
    Color:
    Black and White
    Related Categories:
    Computers / General

    Reported as spam!

  • Oracle Asset (Functional) Practice Questions for Interviews and Certificati

    https://www.createspace.com/3495382
    List Price: $29.99
    Add to Cart
    Oracle Asset (Functional) Practice Questions for Interviews and Certification Examination (Release 11i and 12)
    Functional Consultant
    Authored by Erp Gold
    This book contains 150 Oracle Asset Practice Questions for functional consultants. Very useful for interviews and certification examinations.
    Publication Date:
    Oct 26 2010
    ISBN/EAN13:
    1456311581 / 9781456311582
    Page Count:
    94
    Binding Type:
    US Trade Paper
    Trim Size:
    6" x 9"
    Language:
    English
    Color:
    Black and White
    Related Categories:
    Computers / General

    Reported as spam!

  • Best practice question -- copy container, assemble it, build execution plan

    So, this is a design / best practice question:
    I usually copy containers as instructed by docs
    I then set the source system parameters
    I then generate needed parameters / assemble the copied container for ALL subject areas present in the container
    I then build an execution plan JUST FOR THE 4 SUBJECT AREAS and build the execution plan and set whatever is needed before running it.
    QUESTION - When i copy the container, should i delete all not needed subject areas out of it or is it best to do this when building the execution plan? I am basically trying to simplify the container for my own sake and have the container just have few subject areas rather than wait till i build the execution plan and then focus on few subject areas.
    Your thoughts / clarifications are appreciated.
    Regards,

    Hi,
    I would suggest that you leave the subject areas and then just don't include them in the execution plan. Otherwise you have the possibility of running into the situation where you need to include another subject area in the future and you will have to go through the hassle of recreating it in your SSC.
    Regards,
    Matt

  • SAP Adapter Best Practice Question for Deployment to Clustered Environment

    I have a best practices question on the iway Adapters around deployment into a clustered environment.
    According to the documentation, you are supposed to run the installer on both nodes in the cluster but configure on just the first node. See below:
    Install Oracle Application Adapters 11g Release 1 (11.1.1.3.0) on both machines.
    Configure a J2CA configuration as a database repository on the first machine.
    Perform the required changes to the ra.xml and weblogic-ra.xml files before deployment.
    This makes sense to me because once you deploy the adapter rar in the next step it the appropriate rar will get staged and deployed on both nodes in the cluster.
    What is the best practice for the 3rdParty adapter directory on the second node? The installer lays it down with the adapter rar and all. Since we only configure the adapter on node 1, the directory on node 2 will remain with the default installation files/values not the configured ones. Is it best practice to copy node 1's 3rdParty directory to node 2 once configured? If we leave node 2 with the default files/values, I suspect this will lead to confusion to someone later on who is troubleshooting because it will appear it was never configured correctly.
    What do folks typically do in this situation? Obviously everything works to leave it as is, but it seems strange to have the two nodes differ.

    What is the version of operating system. If you are any OS version lower than Windows 2012 then you need to add one more voter for quorum.
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • SAP Adapter Best Practice Question for Migration of Channels

    I have a best practice question on the SAP adapter when migrating an OSB project from one environment (DEV) to another (QA).
    If my project includes an adapter channel that (e.g., Inbound SAP Proxy listening on a channel), how do I migrate that project to another environment if the channel in the target environment is different.
    I tried using the search and replace mechanism in the sbconsole, but it doesn't find the channel name in the jca and wsdl files.
    What is the recommended way to migrate from one environment to the other when the channel name changes?

    I have a best practice question on the SAP adapter when migrating an OSB project from one environment (DEV) to another (QA).
    If my project includes an adapter channel that (e.g., Inbound SAP Proxy listening on a channel), how do I migrate that project to another environment if the channel in the target environment is different.
    I tried using the search and replace mechanism in the sbconsole, but it doesn't find the channel name in the jca and wsdl files.
    What is the recommended way to migrate from one environment to the other when the channel name changes?

  • Looking for authorized 1Z0-514 practice questions

    I'm studying for the 1Z0-514 - Oracle Database 11g Essentials exam. I have gone through all of the tutorials in the 11g 2-day DBA manual and Oracle By Example supplement. I think I'm ready but would like some practice questions to test myself. According to http://www.certguard.com/, every hit on Google for "1Z0-514" is a braindump. That site also lists a number of reputable sites for practice exams, although none of them includes 1Z0-514.
    Q1: Does anyone know of a verified source of legitimate 1Z0-514 practice questions?
    Q2: Does anyone know how relevant OCA practice exams (1Z0-052) would be for 1Z0-514? They seem to have a lot of common ground.

    Hi, I had the same problem you are having now a few months ago, after studying the 11g 2-day DBA manual I couldn't find any authorized practice questions.
    I ended up going through OCA books and practice questions. I advise you use them, the 1z0-052 and 1z0-514 exams cover very similar topics.

  • Need 1z0-144 Practice Questions (Dumps)

    Hi All
    I need practice questions for 1z0-144 exam.
    Study material, as everybody knows, is available but in scattered form.
    Please tell me any resource for getting the questions.
    Thanks and Regards.

    Using such methods is illegal.
    See Need Oracle OCA Dumps and other such threads. Use the search link above.
    http://blogs.oracle.com/certification/entry/0477
    http://blogs.oracle.com/certification/2009/05/the_route_you_choose.html
    HTH
    Srini

  • Need oracle practice question for OCA

    Need oracle practice question for OCA.
    Edited by: 823938 on Dec 27, 2010 10:21 PM

    It's illegal to use dumps.
    Read the following link:
    http://www.certguard.com/braindumps.asp

  • Practical question: How to transfer ASM backup files?

    Hi friends:
    A practical question:
    all dev, production database using ASM for storage, production db using RMAN did full backup. (everyday night, one copy redundancy)
    For example, production database is down, then in short time, it is hard to repaire back online, then, I want to transfer ASM backup files(sets) to dev database, make dev as a quick temporary production db.
    question: how can you find full backup sets (location) and how to trasnfer?
    thanks a lot in advance.
    Message was edited by:
    jerrygreat

    You can find backupsets by using the
    list backupset
    command
    and you can transfer them using the
    backup backupset command.
    Both commands are fully documented in the RMAN documentation for 10g.
    Please read it.
    Obviously changing a dev database into a production one has little to do with proper backup and recovery procedures.
    Sybrand Bakker
    Senior Oracle DBA

  • Best Practice Question

    I have 3 Areas for my DWH
    The first area is Staging then validation and core
    Staging is just do load date from the source systems
    validation is to validate data (every city has to have a countrie ....)
    core is my DWH shema.
    The First step in ETL is to load the data from core to validation, let's say my GEO_DIM Dimension goes to Countries, Cities and Regions in core. Additionaly I build a CRC SUM when I downlaod from Core to Validation and store the CRC Checksum in a Staging table.
    The second step is to load target from the source systems to staging, but only those date that are non equal to the previous downloadet CRC schecksum, so only changed or new data going to staging.
    The third step is do load that new/changed data from staging to core and proof some dependences. It's just validation.
    My Question is, what is the best practic to bring three tables (Countries, cities and region) to one Dimension
    thanks and regards
    Andreas

    Andreas,
    I guess the correct is depends... Without kidding, are you planning to use a flat star table for this dimension? If that is the case you would be joining the sources together and loading this into the table.
    Now this sounds way to simple, so I guess there is something more to the question...
    Jean-Pierre

  • Informatica and Essbase Best Practice questions

    We now have the Informatica adapter for Essbase installed and working. We have been able to get Informatica to upload data successfully. Now I have a few questions that I have not been able to find answers to in any documentation or forums for Informatica or Essbase. I have submitted these same questions to the Informatica Support but thought I would also post the questions here to see if many folks are using Informatica against Essbase.
    We are using:
    Informatica 8.6.1 (Linux)
    Essbase 11.1.1.3 (Windows 2003)
    1) I can see in Informtica that when we load data to Essbase (Target) it gives me the option to run a calc script AFTER it loads the data. However, if I need to run a Calc script BEFORE the load to Essbase (Target) what is the best practice? The work around I have found was to add the same session twice and for the 1st instance select the option to 'ONLY RUN THE CALC SCRIPT' on the mapping tab. The problem with this is the log shows that it will still run the query against the Source tables. This will impact run times and double to querying against the Source database. What is the Best Practice and proper way to build the workflow to Run a Calc Script BEFORE the load?
    2)Since you do not see the list of Calc Scripts for Essbase in Informatica (you have to manually type the Calc name), If I want to run the 'Default' calc for Essbase what is the syntax to run the 'Default' Calc Script? Tried 'Default' but didn't seem to work.
    3)I have other tasks in Essbase I want to do before actually having Informatica load the data. I would like to run the MAXL commands via a Command task. What is the Best Practice for doing this and the syntax to run MAXL commands in a Command Task in Informatica? I previously had Shell scripts built on the Informatica server that would be kicked off within Informatica, but we are trying to move away from shell scripts and instead have the scripting codes IN the workflows/sessions to make it easier to review the code and follow the logic, rather than having to find the scripts and open each of them.
    Any assistance you have with the two products working together I would GREATLY appreciate it!
    Robert

    AS i know addUser(User user){ ... } is much more useful for several reasons:
    1.Its object oriented
    2.its easy to write , because if Object has many parameters its very painful to write method with comma seperated parameters

  • BPM Workspace Customization & User Interface: Best Practice Question

    Hi All,
    This is our first BPM Project in house and we are on Oracle BPM 11g.
    The business process involves request for approval for a permit from a public user and internal users need to approve/reject the same. Pretty simple and straightforward so far.
    But we are now having lots of questions wrt to user interface.
    1. Work Space Changes.
    If we develop this application completely in Oracle BPM, the outside user (general public) will also see the 'workspace' with its current interface. It would be impossible to handle user training on this interface for a simple Joe Bloe, who may not be computer savvy) So the requirement documents demand that the look and feel of the outside users should be totally different than what the workspace provides. They want this to be customized in such a way that iit would strip all of the default lay out (left navigation bar, and get rid of the upper section completely. with its list of tabs) and also to modify the task list that appears below).
    We have figured out how to achieve this (by modifying the workspace .jar files and recompiling the same), but is this a good approach? What happens if we are developing a brand new application on the BPM in our shop? This change will affect that application as well, as the workspace is shared and common to all the apps? I want some of you experts to let us know, your thoughts on this. If this is not a recommended practice, what would be best way to achieve what we want using Oracle BPM? (Where we want a simple intuitive user interface, without the default add ons that comes with the work space)...
    2. What would be the best method to create a user registration page (where a user creates his own login and password and maintains his account) for an application using the BPM ? Right now we are thinking this should be in either a ADF page/ JSP page or (worst case a PL SQL cartridge) that can be launched on the browser, which will be open and does not require any kind of authentication to access. Is this a good practice or recommended one? Or are we missing out on something within BPM application itself, that we are not aware of and that would let us do this?
    3. Also, if we go with an external ADF application for the 'public' user interface developement, then how can we (or can we) leverage the BPM's internal storage for the submitted data from the payload? I understand that it stores this information currently on the server 'soa infra' tables some where? Thru an external ADF app, can we write into these tables (Is this recommended or just sounds plain ridiculous)???
    Knowing answers to these questions will help us decide, if this is the right tool for the job at hand.
    Appreciate your time and xpertise.
    Thanks
    SR

    Hi All,
    This is our first BPM Project in house and we are on Oracle BPM 11g.
    The business process involves request for approval for a permit from a public user and internal users need to approve/reject the same. Pretty simple and straightforward so far.
    But we are now having lots of questions wrt to user interface.
    1. Work Space Changes.
    If we develop this application completely in Oracle BPM, the outside user (general public) will also see the 'workspace' with its current interface. It would be impossible to handle user training on this interface for a simple Joe Bloe, who may not be computer savvy) So the requirement documents demand that the look and feel of the outside users should be totally different than what the workspace provides. They want this to be customized in such a way that iit would strip all of the default lay out (left navigation bar, and get rid of the upper section completely. with its list of tabs) and also to modify the task list that appears below).
    We have figured out how to achieve this (by modifying the workspace .jar files and recompiling the same), but is this a good approach? What happens if we are developing a brand new application on the BPM in our shop? This change will affect that application as well, as the workspace is shared and common to all the apps? I want some of you experts to let us know, your thoughts on this. If this is not a recommended practice, what would be best way to achieve what we want using Oracle BPM? (Where we want a simple intuitive user interface, without the default add ons that comes with the work space)...
    2. What would be the best method to create a user registration page (where a user creates his own login and password and maintains his account) for an application using the BPM ? Right now we are thinking this should be in either a ADF page/ JSP page or (worst case a PL SQL cartridge) that can be launched on the browser, which will be open and does not require any kind of authentication to access. Is this a good practice or recommended one? Or are we missing out on something within BPM application itself, that we are not aware of and that would let us do this?
    3. Also, if we go with an external ADF application for the 'public' user interface developement, then how can we (or can we) leverage the BPM's internal storage for the submitted data from the payload? I understand that it stores this information currently on the server 'soa infra' tables some where? Thru an external ADF app, can we write into these tables (Is this recommended or just sounds plain ridiculous)???
    Knowing answers to these questions will help us decide, if this is the right tool for the job at hand.
    Appreciate your time and xpertise.
    Thanks
    SR

  • Best practice question for Bounded task flows

    We are new to Jdeveloper/ADF and I was wondering if we should always try to use a bounded task flow for our applications... is this considered the best way to develop an app? even the small single page ones?
    Thanks in advance.

    Hi,
    let me turn teh question around: How many tools do you have at home beside of a hammer ? In other words, its the problem you need to solve (and use cases are problems) that should determine the use of bounded task flows and its granularity. Note that for each use case the bounded task flow makes a good candidate for delivering it. Doesn't mean that every single page needs to go into its own task flow. For general bounded best practices have a look here
    http://www.oracle.com/technetwork/developer-tools/jdev/adf-task-flow-design-132904.pdf
    Frank

Maybe you are looking for

  • How can I use a layer system of images, boxes, lines etc

    Hi, I trying to develop a map system which can have layers added and removed from screen at request. I have a basic map picture which I would like to add a grid structure to which can be added and removed by the click of a JMenuItem. My code looks li

  • ITunes purchases not showing in iTunes and not transferring to iPod shuffle

    I Have been using ipod shuffles for several years as they are small and convenient for running. I have purchased 175 songs on iTunes and been forced to purchase FIVE iPod shuffle devices because the battery life in all five devices degrades after app

  • Turning ARCHIVELOG on & off with Instance in Status OPEN

    I came to know the new feature in 11gR2 Turning Flashback Database on & off with Instance in Status OPEN ( Uwe Hesse blog) for archivelog , why its not possible? why we are changing archivelog mode in mount stage? is it possible in future releases to

  • How to read XML file kept on NON-SAP server using the Http URL ?

    Dear Experts, I am working on CRM2007 web UI. I need to read a XML file placed on a shared server location by a third party program. Then process that XML file into CRM and create a quotation using the data extracted from the file. All i have with me

  • Can't update iPhoto 8.0.2 8.0.4

    I've got three Mac laptops, all less than 2 years old, all running 10.5.7. On two of them I was able to update iPhoto to 8.0.4, using the "software update" function in the top left corner of the main screen. But, on the last one, a MacBook 2.1 GHz, I