A bundle of questions

Hi,
I have several questions and hope that someone could help me.
Q.1
//in fileA.java
package p1;
public class A {
protected int i = 10;
public int getI(){return i;}
//in fileB.java
package p2;
import p1.*;
public class B extends p1.A
public void process(A a)
a.i = a.i*2;
public static void main(String [] args)
A a = new B();
B b = new B();
b.process(a);
System.out.println(a.getI());
Why the object b cannot access i ?
Q.2
public class Test {     
     public static void main(String [] args)
          int ia[][] = {{1,2}, null};
          int ij[][] = (int[][])ia.clone();
          System.out.println((ia==ij) + " ");
          System.out.println(ia[0]==ij[0] && ia[1]==ij[1]);
Why is the result: true, false. When should I use the object.clone()?
Q.3
public class Test {     
     public Test(){
          s1 = sM1("1");
     static String s1 = sM1("a");
     String s3 = sM1("2");
          s1 = sM1("3");
     static
          s1 = sM1("b");
     static String s2 = sM1("c");
     String s4 = sM1("4");
     public static void main(String [] args)
          Test it = new Test();
     private static String sM1(String s)
          System.out.println(s);
          return s;
Why the results are a b c 2 3 4 1? Why '1' will be the last one to be displayed?
Q.4
public class Test{     
public static void main(String [] args)
     int x = 4;
     int a [][][] = new int[x][x=3][x];
     System.out.println(a.length + " " + a[0].length + " " + a[0][0].length);
Why the answer is 4 3 3 ? Why the last 3rd dimension of array is 3?
Q.5
public class Test{     
public static void main(String [] args)
     String str = "111";
     boolean a[] = new boolean[1];
     if (a[0]) str = "222";
     System.out.println(str);
Why the a[0] represents false?
Thanks for your kind help.
gogo

A1.
It can!
A2.
The result is false, true.
A3.
When the class is loaded, all the static blocks and variables are initialized.
When you create a new Test object, then it first initialize all your non-static variables before it goes on with your constructor.
A4.
new int[4][3][3].. thats why
A5.
When you create e.g. a boolean array and don't initialize it, all elements will be false.

Similar Messages

  • ASR9K bundle-ether question

    hi guys,I have a question need confirm,could some friends help me.
    the topology is like this
    1 .does this portchannel support or not ,I mean ASR9001 side is router subinterface,C4500X side is SW trunk interface
    2.if this portchannel is support,could i use lacp mode active ?(the old cisco router is not support lacp mode active like this case,only can use on mode)
    Thank you very much.

    Yup this is very much supported and I would recommend to use the option of running lacp for member management.
    mode-on means that all members are hard inserted in the bundle with no state control. mode active means that you are running lacp and negotiate with the peer the member state and inclusion in the bundle.
    on the a9k side you need to define EFP's or subinterfaces in order to peel out the different vlan's for either use as a routed interface or for insertion into a bridgedomain or xconnect.
    regards
    xander

  • Bundle Version Question

    Hello,
    I'm in the process of putting together an update for our app on the app store and I have a question about what I need to change in the info.plist file. From what I understand, I basically leave the bundle identifier and the bundle name the same. What about Bundle Version? Does this correspond to the version of my application? Currently it says 1.0. Should I change this to 1.1 since that is the updated I'm submitting to the app store?
    I haven't been able to find any information on exactly what Bundle Version is for. Any help would be greatly appreciated.
    Thank you,
    -Keith

    Thanks Bruce, that is what I'm thinking too, but I don't want to mess something up. To the people out there that have submitted updates. Did you change the Bundle Version number?
    Thanks,
    -Keith

  • Bundle Renewal Question?

    I have a regular Verizon account and I purchased a one month phone card for someone for the prepaid phone.  I am having trouble understanding how everything works with the Prepaid when I look at the account because it is different from my regular account.  The prepaid account card ran out on 9/21.  It looks like on 9/22 it says "account change" and my cell phone number is after it.  Then right after that at the same time it has "Bundle Renewal" and my number shows up.  A text message was sent to that phone from Verizon saying they were not able to renew it.  Did my friend try to charge a month to my cell phone account somehow? 

    Thanks Bruce, that is what I'm thinking too, but I don't want to mess something up. To the people out there that have submitted updates. Did you change the Bundle Version number?
    Thanks,
    -Keith

  • A bundle of questions from an iPhone newb...

    Ok so me and my wife recently both got the iPhone 4, and so far we love it. We haven't had any issues, except a tricky time getting the phones to hook up to the wifi here at our house but that was resolved pretty quickly. So here we are, two iPhone rookies and we had a few questions that we didn't get around to asking the sales guy because we didn't want to hold up the 50 other people behind us in line... waiting in the rain... at 6a.m. So here's a short list of questions I was hoping to get answered. I tried searching the message boards but couldn't quite find the answers I needed.
    1) What all exactly constitutes data usage? Sounds simple, but we just came from another carrier with an unlimited data plan and we never thought about how much we used, until we got stuck with the 2gig cap imposed by AT&T.
    2) Does the data usage covered by my plan get drained even when I'm on my home wifi connection? In relation to that, is it better to stay connected to wifi or the 3G cell network?
    3) Is the 2gig cap on data usage per phone or shared between us?
    4) Which apps use the most the data? Please don't say Facebook or the news... those are the two apps I use most....
    Thanks for any answers!

    Hi Josh,
    You live in a populated area, so you probably have WiFi most places. Thus, if you are at Starbucks and hop on their WiFi, there is no data usage from ATT's standpoint. If you are in Starbucks and don't hop on their WiFi and surf the net, then you'll get data usage.
    Go to Settings -> General -> Usage and then scroll down to Cellular Network Data and it will tell you how much you used. Keep an eye on it for a few months (you can reset it whenever you like) and you'll have a good idea of how much data you are using.
    Enjoy your phones!

  • SOA Bundle deployment question

    One creates a SOA bundle consisting of three projects. If one of the projects fails deployment - do the others get deployed or does the entire SOA Bundle fail deployment?
    Thanks - Casey

    Enterprise manager currently is looking for composite in zip file, ideally this should not be the case.
    Use JDEV or WLST sca_deployComposite command(for production env) to deploy soabundle.

  • Adobe Acrobat (OEM/Bundled?) questions

    We have several older Dell PCs that had Adobe Acrobat 6-8 installed on them from Dell (I assume it's an OEM type license.)  But reading through the EULAs, I can't find any mention of OEM or anything.  Are these truly OEM copies?  We received the actual Acrobat CDs with the computers.  As we are beginning to decomission these older machines, we have two questions -
    1. Can we install these copies of Acrobat on newer PCs, or are they truly OEM and stick with the machine that is now aging out and useless, and
    2. Can we use these licenses as the basis for upgrade licenses to Acrobat X on new machines?
    Thanks.

    AFAIK there wouldn't be a difference in the number of computers you could install it on, or the ability to move from one system to another...
    As for the second question, you're probably okay but only Adobe Customer Support could answer for sure.
    Worst case, you could order the upgrades and then if they don't work out for some reason you could just return them under Adobe's 30-day refund policy.

  • How to internationalize Poll question

    Hello
    I am using Jdeveloper Studio Edition Version 11.1.1.4.0.
    Build JDEVADF_11.1.1.4.0_GENERIC_101227.1736.5923
    WebCenter Portal application.
    Currently I want to use poll services in my pages. and everything is ok when using one language, but my polls need to support 2 languages.As I noticed the question text is saved in QUESTION_TEXT column in WC_SURVEY_QUESTION table. I did not find any solution to internationalize the same poll question. is it possible to internationalize the polls question. If yes, How can I do it?
    any help will be highly appreciated.

    You want to results to be included into the same resultset instead of having two seperate resultsets...
    I think the best way to do this is to create your own taskflow using the poll data controll.
    This way you can create the poll using the regular interface but you don't use the OOTB taskflow to show the poll.
    When you display the questions and answers from the data control, you can call a resource bundle instead of adding the text you have defined when creating the poll.
    For example when you create a poll you can say QUESTION_1 as the question and when you display the question you use #{bundle[row.question]} or something like that.
    I think this is the best way to achieve what you want...
    official documentation on the polls data control: http://download.oracle.com/docs/cd/E17904_01/webcenter.1111/e10148/jpsdg_polls.htm#CIHJHCEH
    Edited by: Yannick Ongena on Apr 18, 2011 9:14 AM

  • Resource bundles, loading in beans or in jsp or share them?

    Hi,
    I have a question and hope it is not a stupid one.
    What is the best way to work with resource bundles/messages developing faces application?
    One way is to load and use it in jsp. It is convenient and easy. Another is to use it within a bean. It's a little bit more complicated and might take more memory. Taking into account that sometimes general messages are to be used in both is there a guideline or some usual practice on how do I can access a resourcebundle that been loaded in jsp from bean?
    Suppose I have couple beans that might use the same messages - logically it is better to load bundle in jsp and use it from beans.
    Of course it could be loaded via faces config file, but some messages are needed only by couple of pages (registration for example).
    Please let me know your thoughts or how it is done usually.
    Thanks in advance!!

    You can use as many f:loadBundle tags in the JSP page as you want. You can also use them simultaneously with any <message-bundle> and/or <resource-bundle> declaration in the faces-config.xml. Just choose the one which covers the scope of the bundle in question.

  • How to find content of a constraint etc.

    Hi,
    select constraint_name
    from user_constraints
    where table_name = 'EMP';
    shows to two constraints for the given table of EMP. Now, how to find CONTENT of each of these two constraints?
    Secondly, how to find if a particular column is nullable (programmatically, not from DBA tool set)? e.g. EMP.deptno
    Thirdly, why did I get the err msg of "inserted value too large for column"
    when executing the following command for data insertion to EMP as user, scott
    create SEQUENCE emp_sequence
    start with 8000 increment by 10;
    insert into EMP values (emp_sequence.NEXTVAL,'JOE','Researcher',null,null,null,null,null);
    Thanks a bunch.

    Thirdly, why did I get the err msg of "inserted value too large for column"Er, do the math...
    SQL> conn scott/tiger
    Connected.
    SQL> desc emp
    Name                                      Null?    Type
    EMPNO                                     NOT NULL NUMBER(4)
    ENAME                                              VARCHAR2(10)
    JOB                                                VARCHAR2(9)
    MGR                                                NUMBER(4)
    HIREDATE                                           DATE
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                             NUMBER(2)
    SQL> select length('researcher') from dual
      2  /
    LENGTH('RESEARCHER')
                      10
    SQL>
    Secondly, how to find if a particular column is nullable (programmatically, not from DBA tool set)Don't like the sound of this, smells of dynamic coding. Anybody who can't figure out why they can't create an EMP record for a researcher probably ought not to be tangling with dynamic SQL just yet.
    Now, how to find CONTENT of each of these two constraints?The CONSTRAINT_TYPE tells you the sort of constraint: P=PRIMARY KEY, U=UNIQUE, R=FOREIGN KEY and C=CHECK. Only Check constraints have any content as such and you'll find that in the SEARCH_CONDITION. Note that this is a LONG column, so you may need need to SET LONG 5000 to see it in SQL*Plus.
    Cheers, APC
    P.S. In future please refrain from bundling unrelated questions into a single post. There is no charge for posting and it avoids the threads getting long and hard to follow.

  • Requirements for 9iAS Integration

    After days of plugging through the documents, reading manuals and searching google's archives, I am still not sure exactly what is need to get this going. We would like to set up the Integration piece (Interconnect, Workflow, IStudio) within our enterprise. We are trying to get this working on a Windows 2k server. I have formatted the server several times for one reason or another. I am hoping to avoid this in the future.
    I have amassed a bundle of questions:
    1. What parts of 9ias are required for this to work
    2. Does the Metadata Repository have to be on the same box as the Hub?
    3. Can I use an existing 9i database as the Metadata Repository instead of creating a new database?
    4. How do I define the path to the Workflow homepage?
    Thanks for any help,
    Chris

    1.
    For building integration apps you would need InterConnect and Database, preferably the iasdb ie. Infrastructure db, for message hub and hub repository (schema).
    Note that Metadata Repository is another name for the Database included in O9i AS (a 9.0.1 db) loaded with a bunch of "repositories" (schemas) for various AS components like Portal, Discoverer, OEM and Workflow.
    2.
    If you mean the InterConnect install type "Hub"- no.
    (but in the hub and spoke model, Metadata Repository is used as hub)
    In my experience, Oracle has a lot of work left to do on InterConnect. Documentation is useless - and now I'm being nice. Support looks weak and has failed miserably when dealing with basic stuff.
    (Perhaps this has something to do with OAI being hidden in Applications in previous incarnations?).

  • ASPLeopard not combatible message at mail startup

    Hello,
    I have upgraded my macbook pro to Snow Leopard.
    When launching mail I get the following message (french):
    Modules incompatibles désactivés
    Mail a désactivé les modules suivants:
    ASPLeopard
    Contactez les éditeurs de ces modules pour en obtenir des versions compatibles avec Mail 4.2 et Message 4.2
    I can't find anywhere anything about ASPLeopard.
    Can someone help?

    I don't know. If you go into your user/Library/Mail folder, there should be a Bundles (disabled) folder which should hold the bundle in question. Maybe digging inside it you can find the source.
    It is very odd that you can't find anything on it searching the internet.

  • Flash based exam simulator

    Hi,
    We have been doing web application development using java
    till now. We have a requirement to develop a standalone exam
    simulator using flash . However the application would do the
    authentication over the net. We would want an exe to reduce the
    chances of someone hacking the source code. How should we bundle
    the questions with the application? We would want to protect the
    content of the questions so that no one can copy and paste the same
    Thanks in Advance,
    David

    Hi,
    I also had this problem.
    I found that rebooting Flash helped to refresh the Sim Controller.
    Then sometimes it works one time in the simulator, sometimes not.
    If it works more than once I feel lucky, but it usually fails the next time I test it ( without changing any code ).
    This is obviously a bug. I think that there is some kind of connection between the simcntroller app and ADL which is failing. It's probably timing?
    Stevee

  • Error 259 deploying Install MSI action

    Long time ago it was supposed to be fixed
    Support | Error 259 deploying Install MSI action
    I am sure that bundle in question (Autocad 2011 Deployment install from network with credentials &
    dynamic admin) worked fine in 11.2.2
    After upgrade to 11.2.3a it gives me this error & fails
    Not really helpful
    (and please do not advice me to install it by copying it to local machine, I
    am not interested in this)
    Seb

    Originally Posted by AndersG
    GarethWilson,
    > Autocad was running as dynamic administrator and not SYSTEM, and its
    > defo a zenworks issue, if you take the same command line that you have
    > in the zcm bundle and then put that in a batch file and run that as
    > dynamic administrator the application installs fine without
    > errors.....its only when the command line is in the zcm bundle the error
    > occurs.
    OK. If that is the case, then it sounds like a bug. Can you open an SR to
    have it looked at?
    FWIW, running Procmon, once for the ZCM bundle and once for the batch and
    capturing logs might provide some additional info.
    Anders Gustafsson (NKP)
    The Aaland Islands (N60 E20)
    Have an idea for a product enhancement? Please visit:
    http://www.novell.com/rms
    There maybe just something in the autocad installer that doesnt like being called from the zen agent, it wouldnt be the first time a company has written a dodgy setup process lol what we found also was that if you put in /W in the autocad commandline which is a switch for SCCM then the installer behaved correctly, so i think the issue is actually with their installer rather than zenworks now.

  • Search application in s1ws6.1

    I've got a bundle of questions about the search engine that comes with Web Server 6.1, replacing the Verity engine in previous editions.
    The biggest issues are: How do we (or, eeek!, can we) add custom properties to documents that can then be searched on, like: author, categories that we define, published date (as opposed to file date, which is not correct).
    It seems like we were able to do this in Verity, but I can't seem to find whether it's possible in the new version of search.

    Thank you, It is very useful.
    Can I use the portal search engine for production purpose?
    "Panji Aryaputra" <[email protected]> wrote:
    I just managed to make it work yesterday.
    To use it follow these steps:
    1. Run the sample portal app (start the server).
    2. There is this directory: weblogic81\portal\thirdparty\search. There
    are 3
    files there, run the startSearchDREEngine.cmd and startSearchEngine.cmd.
    Before running those two, set the environment first by running set-dbenv.cmd
    and setDomainEnv.cmd (I don't have time yet to check which one is really
    required). These two files can be found in your domain directory.
    3. Configure the search by opening portal admin and click on search
    configuration (top menu, bottom right). If you can't see the configuration
    after clicking the menu, that means your search engine is not started
    yet.
    4. Go to avitek portal, try to do some search in the search portlet.
    You may
    not see the result immediately, depending on whether the index has been
    created by the search engine. In my case, this is where I tought the
    search
    didn't work. If you want to check further, you can see the index created
    here \weblogic81\portal\thirdparty\search\windows\HTTPFetch (if you are
    using HttpFetch).
    This part, imo, is poorly documented (perhaps I was too dumb to read
    the
    manuals properly) :D
    Hope that helps you guys. CMIIW
    panji.a

Maybe you are looking for

  • Blend Like a Boss With the BlackBerry Blend 1.2 Update

    Reposted from Inside BlackBerry We’ve said it before, and we’ll say it again now: BlackBerry Blend is the best productivity booster, and with the latest update, BlackBerry Blend 1.2, navigating and interacting with your BlackBerry device messages and

  • Should the screen show when the ringer switch is changed?

    My ringer is not working on my 4S with 7. Should the screen show when the mute switch is changed from on to off and back? I believe it did before.

  • Upgrade Unity and CM

    Hi, What do I need to do to upgrade my CM 8.5.1, and Unity 8.0.3 to the newest version. Thanks

  • Is it possible to place a native button in popup messages?

    Hi Experts,                    I have a requirement of sending the control back to driver application for my ADLC form after user has entered a sting of more than 105 characters in a text field. Since certain complex processing needs to be done and j

  • Pages file can't be opened

    Hi, I was working on a pages file, then a message appeared, once i selected the "Revert" option, the file has been closed and i can't re-open it again. the message is: " the file name.pages" can't be opened. i upgraded all versions and deleted the ol