Need clarification: SCJP questions

The following code when pasted in eclipse is giving a compilation error but the answers are as given below!!
Please explain.
Question 1
Given:
11. static classA {
12. void process() throws Exception { throw new Exception(); }
13. }
14. static class B extends A {
15. void process() { System.out.println(�B �); }
16. }
17. public static void main(String[] args) {
18.A a=new B();
19. a.process();
20.}
What is the result?
A. B
B. The code runs with no output.
C. An exception is thrown at runtime.
D. Compilation fails because of an error in line 15.
E. Compilation fails because of an error in line 18.
F. Compilation fails because of an error in line 19.
Answer: F
Question 2
Given:
11. static class A {
12. void process() throws Exception { throw new Exception(); }
13. }
14. static class B extends A {
15. void process() { System.out.println(�B�); }
16. }
17. public static void main(String[] args) {
18. new B().process();
19. }
What is the result?
A. B
B. The code runs with no output.
C. Compilation fails because of an error in line 12.
D. Compilation fails because of an error in line 15.
E. Compilation fails because of an error in line 18.
Answer: A
Thanks in Advance!!

Please correct me if I am wrong as I am in the learning process.Casting the reference to a B type allows the code to compile because B.process() doesn't throw an exception and the javac compiler is smart enough to catch that. However, catching the exception or declaring main as throwing it also allows the class to compile; the solution does not require casting. Examples:
class A {
    void process() throws Exception {
        throw new Exception();
class B extends A {
    void process() {
        System.out.println("B ");
    public static void main(String[] args) {
        A a=new B();
        try { a.process(); } catch (Exception e) { /* handle */ }
}Or: class A {
    void process() throws Exception {
        throw new Exception();
class B extends A {
    void process() {
        System.out.println("B ");
    public static void main(String[] args) throws Exception {
        A a=new B();
        a.process();
}~

Similar Messages

  • BPM, Workflow and Netweaver - Need Clarification

    Hi Guru,
    I am new to workflow, BPM and Netweaver.  I have several questions about those concepts.
    1. What is/are the different between workflow and webflow.  Which scenario should take workflow into consideration? Which scenario webflow can be applied to?
    2. What is/are the different between workflow and BPM.  If I am going to implement workflow in a company, do I need to implement business workflow as well as BPM?
    3. I need clarification on Netweaver platform and concept.
    4. What is/are the different between workflow in R/3 and workflow under Netweaver?
    5. If I am going to implement workflow integrated with R/3 and Outlook email, do I need to buy new wrokflow for Netweaver and Netweaver platform or alternatively, I can use business workflow module under R/3 system?
    Sorry for many questions asked. I am new to those products.  I am now working on software selection for workflow technology.  My company is going to implement new workflow to client.  Thank you very much.
    Cheers,

    Please ask only one (or closely related) questions per thread. This makes it a lot easier to get a good structure in the database of previously answered questions. While we are on the subject of previously answered questions, I think you should have a look at them....
    My suggestion is therefore:
    1. Close this thread
    2. Read the Frequently Answered Questions. Before you ask (here are many workflow answers)
    3. Search the forum.
    4. Create new threads if you have questions afterwards.

  • Need clarification for these names, R/3, WAS, NetWeaver

    Hi All
    I posted the question on WAS preview installation, then I realized I should have put it here. Here is the link to that post:
    Need clarification for these names, R/3, WAS, NetWeaver
    Thanks again for any input
    Xueqing
    Added the link to the first post
    Message was edited by: xueqing Han

    Hi Xueqing,
    First of all, sorry for any confusion that we have caused you. I hope I can give you an answer that will clear up the confusion. Sorry, but it is a long explanation of the development of two application solution but history tends to be very long winded!
    It is <b>not</b> true SAP R/3 Enterprise equals SAP Web AS, and I'll hopefully explain why:
    In the beginning (at least in the client server world) SAP only ship SAP R/3. The technology layer under SAP R/3 was called SAP Basis. There was only SAP Basis under SAP R/3.
    SAP then started to deliver other software solutions that were not included in or built on the SAP R/3 software. These included SAP Business Information Warehouse, SAP APO, SAP SEM, SAP CRM, and the list goes on.
    These solutions needed to run on technology layer (like SAP R/3 did). SAP Basis was the obvious choice for this because of the common technology layer providing DB/OS abstraction and a coding environment.
    <b>~2001:</b>
    Later there came the need to have SAP Basis support the web and its web standards and other programming languages. This radically changed what SAP Basis was and we decided to rename the new technology layer to SAP Web Application Server (SAP Web AS). So the SAP Basis name was retired and SAP Basis 4.6D was the last release called SAP Basis.
    The new release and the "technology change" means that all the applications mentioned above now ran on SAP Web AS. The first release of SAP Web AS was 6.10.
    <b>~2002:</b>
    SAP Web AS was first used in SAP R/3 Enterprise release .
    The important fact is that SAP R/3 Enterprise runs on SAP Web AS. SAP R/3 Enterprise = SAP R/3 business applications + new business functions + SAP Web AS.
    <b>~2003:</b>
    I hope the above explanation is clear, because technology takes another major change. It was realized that SAP now had a collection of business solutions/applications (SAP R/3, mySAP CRM, mySAP SCM, etc) and a collection of technology solutions (SAP Web AS, SAP BW, SAP EP, etc). The technology requirements for the business solutions did not end at SAP Web AS, they needed portal, data warehouse, knowledge management capabilities, etc to develop business solutions on.
    To address this SAP made the decision to combine all the technology solutions and tools into one single platform. This made complete sense for developers (SAP, Partners and customers). This single platform is called SAP NetWeaver. It includes all the old individual components of SAP Web AS, SAP BW, SAP KM, SAP EP, etc).
    <b>~2004:</b>
    I think you can guess what the next step is. Yes, the new release of SAP R/3. Since the release of SAP R/3 Enterprise and the release of SAP NetWeaver, SAP R/3's name changes. It is now called mySAP ERP as it includes a lot of applications that were previously sold separately (like SAP SEM, MSS, ESS, etc).
    So now mySAP ERP runs on SAP NetWeaver (yes everything that was in SAP Basis and then in SAP Web AS is still there but SAP NetWeaver has so much more now).
    Also with the release of SAP NetWeaver, SAP starts to stop using the old technology component names - you will not hear us talk about SAP Web AS, SAP BW, etc anymore, just SAP NetWeaver releases.
    In addition all the other SAP business applications also run on SAP NetWeaver, so the latest version of mySAP CRM, mySAP SRM, and mySAP SCM all run on SAP NetWeaver.
    So to simplify the explanation, it would be :
    <b>Evolution of SAP R/3:</b>
    SAP R/3 (up to release 4.6c) -> SAP R/3 Enterprise (releases 1.00 through 2.00 -> mySAP ERP (2004 onward)
    <b>Evolution of Basis:</b>
    SAP Basis (up to release 4.6d) -> SAP Web AS (up to release 6.40 which was included in SAP NetWeaver '04) -> SAP NetWeaver (2004 onward)
    SAP NetWeaver and mySAP ERP have <u>their own release cycles</u>. mySAP ERP always has an underlying technology release that it is built on (this is a SAP NetWeaver release)
    I hope this helps,
    Mike.
    <b></b>

  • How do i change my security questions because I tried changing them through manage account password but to get in i need the security question answers :|

    I did as people said to go the apple iD manage account and password and security and to get in i have to answer the security questions but i dont know what they are please help because im trying to purchases something on this computer as it is my first use i need the security question answers

    Ok, so I had the same problem. What you should do is, call the
    Apple Technical Support number: (44) 0844 209 0611
    And ask for the Account Security Team. This worked for me.

  • Need Clarification On Internal tables in Start Routine

    Hi,
    I have intenal table some IT_A which deletes the requests which are populated in to it.
    Now I need to populate requests into IT_A from  another internal table like IT_B which are of different structure.
    I have three fields in common in both internal tables like RNR,Timestamp n SID with different field names
    I Need Clarification that if i move the contents of the three fields to IT_A from IT_B by spcifying these three fields.Will the internal table IT_A deletes the Requests?
    Thanks,
    Sriram.

    Hi Sriram,
    As mentioned IT_A deleted the request loaded into it.
    if you move the contents of the three fields to IT_A from IT_B by spcifying the three fields after the deletion step for internal table IT_A takes place then it wont get deleted.
    But it would be deleted if the the contents are moved before the deletion step takes place
    regards,
    mahesh

  • Need clarification on issue with tablespaces

    Hi All,
    I needed clarification on this issue with tablespaces.I am following a guideline which says "Presently,The general rule of thumb is to concentrate on tablespaces that are 90% or greater used and have less than 2 GB of free space"
    My Scenario:-Now i have tablesace which is 97.23 % and the free space is 10 gb.Please advise me that whats the best next step I can take in this respect?
    I am very new to this and just following the guideline,so can you all please explain me some details about this.
    Thanks

    Well, the guideline says "*and* have less than 2 GB of free space"
    Since that tablespace as 10GB of free space, the guideline says that you do not need to concentrate on it. Eh ?
    I would be careful with guidelines that are hard-coded in this manner. You need to know the context in which the guideline was set.
    Assuming that your database/application doesn't grow suddenly by 1GB or larger (or create temporary segments / objects of 1GB or larger), the "2 GB of free space" might make sense. Then, again, it depends on the extent allocation type. What size are extents getting allocated.
    You should check with your organisation's senior DBAs on what happens if you don't concentrate on a tablespace because it is outside the guidelines !

  • Need clarification on Bigfile Tablespaces

    In the following Oracle Documentation Lirbary PDF,
        Oracle® Database
        Concepts
        10g Release 2 (10.2)
        B14220-02
        October 2005
    section
        Overview of Tablespaces
        Bigfile Tablespaces (page: 3-5)
    it says,
        Benefits of Bigfile Tablespaces
        * Bigfile tablespaces can significantly increase the storage capacity of an Oracle database. Smallfile tablespaces can contain up to 1024 files, but bigfile tablespaces contain only one file that can be 1024 times larger than a smallfile tablespace. The total tablespace capacity is the same for smallfile tablespaces and bigfile tablespaces. However, because there is a limit of 64K database for each database, a database can contain 1024 times more bigfile tablespaces than smallfile tablespaces, so bigfile tablespaces increase the total database capacity by 3 orders of magnitude. In other words, 8 exabytes is the maximum size of the Oracle database when bigfile tablespaces are used with the maximum block size (32k).
    I need clarification on how to arrive at 8 exabytes ?
    1024 x 32k x 64,000 ??
    According to the exerpt above, there's no mention of maximum number of Operating System blocks per extent. Unless this was assumed knowledge ... how do I get 8 exabytes ?
    And if "a database can contain 1024 times more bigfile tablespaces than smallfile tablespaces", then what's the upper limit on smallfile tablespaces ? -- was this sentence referring to the number of datafiles per smallfile tablespace ? ...
    O_o
    Thanks !
    Message was edited by:
    mvanle

    Hi,
    According to [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14237/limits002.htm#i287915]Physical Database Limits page, a bigfile tablespace contains only one datafile or tempfile, which can contain up to approximately 4 billion ( 232 ) blocks. The maximum size of the single datafile or tempfile is 128 terabytes (TB) for a tablespace with 32K blocks and 32TB for a tablespace with 8K blocks. In resume, A bigfile tablespace is a tablespace containing a single datafile that can be as large as 128 terabytes (TB), depending on the block size of the tablespace. In conjunction with setting the initialization parameter DB_FILES to the maximum value of 65,635 the total size of the database can be more than 8 exabytes (EB)
    >>how do I get 8 exabytes ?
    You can calculate the maximum amount of space (M) in a single Oracle database as the maximum number of datafiles (D) multiplied by the maximum number of blocks per datafile (F) multiplied by the tablespace block size (B):
    M = D * F * B. Therefore, the maximum database size, given the maximum block size and the maximum number of datafiles, is:
    65,535 datafiles * 4,294,967,296 blocks per datafile * 32,768 block size = 9,223,231,299,366,420,480 = 8EB.Cheers
    Legatti

  • Need asnwers - interview questions

    Hi Experts,
    I am a novice candidate pursuing for SAP BW/BI opportunities and appearing for different interviews in SAP BW/BI. Following are some of the questions that I was fired by the interviewers. I appreciate your time and consideration for answering my queries.
    1)How do you initialize the setup tables for filling the data of just past three years ?
    And after full load from set up tables and executing the delta, later there is a requirement of adding more application tables in the datasource of LO cockpit.How should we go about without getting duplicate records in the source system and retaining the original delta
    2) what are the general different transformations issues and methods to solve it?
    3) How to handle DTP issues like if number of records were 1000 in DSO object and the Infocube received just 900, bad characters problem,etc
    4) RDA background process flow?
    5) How to have plan/actual comparisons?lets say Profitability analysis.
    Plan infocubes contains which data with respect to actual infocube? Can you explain with example?
    6) In business content activation,how to exclude the objects that have been already activated.
    7)Does change run affect all aggregates or only aggregates containing that master data which is undergoing change run is affected?
    8) Can somebody send me sample Functional requirements design documents/blueprints/detal design docs.
    9) what are functional support issues in SAP BI implementations?
    10) The fastest and best method to improve query performance?
    If I am right, is it Cache settings?
    11) I am also preparing for certification exam BI 7.0 which is on march 7th? I need some sample questions.
    12) Need more information to prepare for SAP BI functional analyst and developer interviews.
    Thanks
    Mujtaba.
    Lot of points will be given for urgent replies.
    Edited by: Nazeeruddin Mujtaba Mohammed on Feb 16, 2008 7:20 PM

    1)How do you initialize the setup tables for filling the data of just past three years ? And after intilization/full load from set up tables and performing the delta, later there is a requirement of adding more application tables in the datasource of LO cockpit.Here we still need delta load for the original records.
    You can give the date  for the past 3 yrs and fill the setup table.
    2) what are the general different transformations issues and methods to solve it?
    Short dump while creating transformation
    Inactive transformations
    Error while copying transformations
    Automatic transformation not possible etc
    3) How to handle DTP issues like if number of records were 1000 in DSO object and the Infocube received just 900, bad characters problem,etc
    You can do it with error handling.( Error DTP, you can maintain in Error DTP and schedule the load from Error DTP to Target).
    You can do
    4) RDA background process flow?
    The RDA concept has been implemented in BI 7 . This is to get the real time data from the source system for a regular interval of one min or more than that .
    http://help.sap.com/saphelp_nw70/helpdata/en/43/fc4d7d87e1025de10000000a1553f7/frameset.htm.
    /people/kamaljeet.kharbanda/blog/2006/11/13/real-time-data-acquisition-bi2004s
    5) How to have plan/actual comparisons?lets say Profitability analysis.
    Plan infocubes contains which data with respect to actual infocube? Can you explain with example?
    Actual data is loaded from R3 or any other source, Planned data is loaded from APo or entered manually...
    U can switch between actual and planned mode and load data from source or enter the data in planned mode..
    Example
    Stock/sales can be predicted and entered in plan mode vs actual mode
    6) In business content activation,how to exclude the objects that have been already activated.
    Chk compare/copy check box...
    7)Does change run affect all aggregates or only aggregates containing that master data which is undergoing change run is affected?
    It will hit the aggregates for which master data changes has happened
    8) Can somebody send me sample Functional requirements design documents/blueprints/detal design docs.
    The Blue print for Business Inteligence:
    http://help.sap.com/bp_biv335/BI_EN/html/Business_Blueprint.htm
    Now if you are looking the Blueprint for any other modules, Select from the list
    http://www.sap.com/services/servsuptech/bestpractices/index.epx
    9) what are functional support issues in SAP BI implementations?
    Check these threads:
    http://help.sap.com/bp_epv170/EP_US/Documentation/How-to/Planning/Master_Guide_NW2004s.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2e8e5288-0b01-0010-2ea8-bcd4df5084a7
    10) The fastest and best method to improve query performance?
    Is I am right is it Cache settings?
    Aggregates
    Avoid nav attributes
    Dont fetch line item dimensions unless needed
    Avoid too many chars in the row
    Avoid using RKF and CKF as it fetch data from database
    Query Read mode(adjust with A, X and H)
    11) I am also preparing for certification exam BI 7.0 which is on march 7th? I need some sample questions.
    Browse SDN..ull find a lot  Chk the link
    https://forums.sdn.sap.com/search.jspa?threadID=&q=BI7.0certification+questions&objID=f131
    Regards,
    B

  • 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

  • Need clarification regarding the test cable-diagnostics tdr command

    Hello,
    I've read about the test cable-diagnostics tdr command but I need clarification on the examples listed below to make sure that I am providing the right answer to my co-workers.
    Example 1:
    CXXX7SW17#show cable-diagnostic tdr int g0/20
    TDR test last run on: July 16 10:23:00
    Interface Speed Local pair Pair length        Remote pair  Pair status
    Gi0/20    auto  Pair A     N/A                        N/A                Normal
                           Pair B     72   +/- 10 meters  N/A                Open
                           Pair C     75   +/- 10 meters  N/A                Short/Crosstalk 
                           Pair D     74   +/- 10 meters  N/A                Short/Crosstalk
    Does this example mean that there's a cable length issue in the line which is causing the device that it's connected to not to work properly?
    Example 2:
    CXXX2SW140#show cable-diagnostics tdr int g0/21
    TDR test last run on: July 16 09:16:22
    Interface Speed Local pair Pair length        Remote pair Pair status
    Gi0/21    100M  Pair A     N/A                      Pair A           Normal
                              Pair B     N/A                      Pair B           Normal
                              Pair C     N/A                     Pair C           Normal
                              Pair D     N/A                     Pair D           Normal
    Does this example state that the cable line is okay for use?
    Example 3:
    CXXX1SW19#show cable-diagnostics tdr int g0/22
    TDR test last run on: July 16 06:36:53
    Interface Speed Local pair Pair length            Remote pair Pair status
    Gi0/22    auto    Pair A       1    +/- 10 meters  N/A               Open
                              Pair B     39   +/- 10 meters   N/A               Open
                              Pair C     72   +/- 10 meters   N/A               Open
                              Pair D     1    +/- 10 meters    N/A               Open
    Does this example mean that there isn't a device connected on the other end? No pin-contact?
    Thank you very much for any help you could provide.
    S

    I found this article here at supportforums that seemed like the best explanation I've read so far for TDR info.
    Hope that helps.

  • I forgot my apple Security Question. So when I Redeem Some money to my account and I want to purchase it's need the security question, I forget it. So how could I reset my security question of apple ID?

    I forgot my apple Security Question. So when I Redeem Some money to my account and I want to purchase it's need the security question, I forget it. So how could I reset my security question of apple ID?

    1. See my User Tip for some help: Some Solutions for Resetting Forgotten Security Questions: Apple Support Communities.
    2. Here are two different but direct methods:
        a. Send Apple an email request at: Apple - Support - iTunes Store - Contact Us.
        b. Call Apple Support in your country: Customer Service: Contacting Apple for support
            and service.
    3. For other queries about Apple ID see Frequently asked questions about Apple ID.
    4. Rescue email address and how to reset Apple ID security questions

  • HT1918 i need to security questions please help me

    i need to security questions please help me
    <Email Edited by Host>

    Read this about how to change the security questions: http://support.apple.com/kb/HT5312
    If you can't use these procedures because you don't have a rescue email address you will have to contact Apple. See http://support.apple.com/kb/HT5699

  • HT5312 I need reset security questions but i don't remember it

    I need reset security questions but i don't remember it
    I login to my apple ID and didn't find under “Password and Security” the TAB  reset security questions
    I need create  rescue email address first?

    You cannot create a rescue email address and need to ask Apple to reset your security questions; ways of contacting them include phoning AppleCare and asking for the Account Security team, clicking here and picking a method for your country, and filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (105391)

  • Pls I want to purchse from iTunes but it need my security question and iforgetit

    Pls I want to purchase using my apple id from iTunes but it give message it need the security question
    But iforget the answer
    Thanks

    If you can't remember them then go to Express Lane  and select 'iTunes' from the list of 'products' in the middle of the screen.
    Then select 'iTunes Store', and on the next screen select 'Account Management'
    Next choose 'iTunes Store Account Security' and fill in that you'd like your security questions/answers reset.
    You should get an email reply within about 24 hours (and check your Spam folder as well as your Inbox) - but some recent posts are saying that Apple have temporarily suspended the reseting of security question/answers whilst account security processes are improved, so it may take longer.

  • Needed Latest  SCJP 1.4 exam pattern +question papers

    Hi,
    I'm taking up SCJP 1.4 exam on 13th Oct.
    Could you please suggest websites for/ send the Latest SCJP 1.4 exam pattern and question papers for me ?
    Thanks and Regards,
    Sanjeev Kulkarni

    Darryl.Burke wrote:
    From the UK:
    Durham University's page on SLAC-HEPNAMES database of EMAIL-IDs in HEPDATA
    {color:#0000ff}http://durpdg.dur.ac.uk/HEPDATA/ID{color}That line is only in the title. The text says
    worldwide directory of email addresses
    >
    From the US:
    University of California's page on Mail ID Name Changes
    {color:#0000ff}http://email.ucdavis.edu/forms/mailidnamechange.php{color}They use MailID (not email id, is an internal identifier) and the text says
    change in your email address then after your old email address expires
    >
    >
    University of North Carolina's page on UNCW E-mail ID Retrieval
    {color:#0000ff}https://appserv02.uncw.edu/dasapps/sec/getid.aspx{color}Once again, Email-ID is again an internal term refering to the use of an email address as a logon id.
    The text, once again, says
    UNCW e-mail username (your e-mail address without the @uncw.edu)
    >
    From Belgium:
    Username: (Email ID) on
    {color:#0000ff}http://customer.netline.be/{color}
    Once again, I see this more as simply an internal reference to an email used as a logon id (so a composite term).
    Madison Area Technical College's page on Student Network/Email ID Choices
    {color:#0000ff}http://matcmadison.edu/matc/studentresources/studentemail/about.shtm{color}
    From page
    {color:#0000ff}http://www.abitmore.be/ssr2001/w3warecb.htm{color}
    ... ... like: change in eMail ID, ... ...
    These site seems to be using like you feel (although the first does not contain enough context to be sure), but they, and every other site listed here, is hardly definative.
    Edit: This is not to be combative, so please don't take it that way. Just expanding on my viewpoint.
    ;-)

Maybe you are looking for

  • ICloud notes and different apple ID

    I have an Apple ID that I use to sign in to Yosemite.  I also later on got a .mac account.  The issue is when I click on iCloud in the System Preferences, (I'm signed in with my Apple ID not my .mac account)  I cannot turn on notes syncing.  It wants

  • How to block a contact

    Hi, can anyone help with blocking a contact. I have followed the instructions : settings-phone- block - add new and I keep getting calls from this number. Thank you

  • How can I enable forwarded emails to be received?

    I have setup 2 HP ePrinters and have a problem The problem is that the settings do not allow automatically forwarded or group emails I have a Gmail account I want emails sent there to be automatically forwarded to the eprinter - not allowed   I have

  • FaceTime is not get signed in, FaceTime is not get signed in?

    Please get me an answer to this problem

  • Verification Text on Date Prompts

    Need to verify that text on date prompts can be eliminated (please enter instruction prompt) Thanks, Rick