Please answer this confusion.

In SCJP exam, if we see a question like below without main method, what to answer? For ex, this below example cannt be compiled.
String foo = "blue";
Boolean[] bar = new Boolean[1];
if (bar[0]) {
foo = "green";
but if you add main method, it will compile fine, only runtime exception will be thrown.
public class C {
public static void main(String[] args) {
String foo = "blue";
Boolean[] bar = new Boolean[1];
if (bar[0]) {
foo = "green";
So, what to answer? Code cannot compile or exception is thrown??? Thanks.

. . . but when it's not present, you can assume
it's there . . .Could you explain that a little further?
String foo = "blue";
Boolean[] bar = new Boolean[1];
if (bar[0]) {
foo = "green";
}By itself, the above cannot compile (even if there are no syntax errors in that code itself) because there's no surrounding class Blah { ... }. But if the question is something like "What happens with the above code? a) doesn't compile, b) runtime exception, ... etc. ..." I would assume that "doesn't compile" applies only if there's a syntax error in that code. I don't think they're testing to see if you recognize that you need the class declaration. They just ommitted to avoid clutter (is my guess).

Similar Messages

  • Will someone please answer this, major iPhone 3GS problem.

    SOMEONE ANSWER ME!!!!!!
    I am almost about to give up hope with this. I have posted FOUR questions with no answers, so someone please answer this one.
    My iPhone 3GS has never  been jailbroken. A couple of months ago now, the bottom half of my iPhone screen became unresponsive so I thought I would try to restore it to see if it would make it alright again. Worst mistake of my life. It is now stuck in recovery mode and will not come out, for anything. I have had various different error messages, i've tried everything. All the software programs, holding home and power and whatever else. Nothing. When trying to restore it, it will come to the last part of the bar and fail. Every single time. I really could do with some help on this one. Please.

    Take a look at this link, http://support.apple.com/kb/HT1414  It's look like your iPhone needs to be repaired, the digitizer is damaged and it could be causing the problem of not letting your iPhone completely restore.  Take your iPhone to your nearest Apple store. 

  • What  are the advantages over sql in pl/sql...can you please answer this?

    Hi,
    what are the main differences between sql and pl/sql...why v are using pl/sql rather then sql...can you please answer this question?

    SQL is used to access the database. PL/SQL is a programming language where SQL is seamlessly integrated. In order to access the database in PL/SQL, you have to use SQL.
    Think of it as two pieces of software, two "engines". If you want to interact with the database, then performance wise it's best to use only one engine (SQL only), instead of two (PL/SQL and SQL). If a PL/SQL program executes a SQL statement, it does a "context switch", i.e. saving its state in PL/SQL before giving control to the SQL engine and vice versa. This is quite fast, but do a lot of them and it is slow, so beware of programming SQL statements inside loops.
    Another way to put it: SQL is a fourth generation language (4GL) where you tell what you want, not how. The software, the optimizer, will decide for you how to process the statement. PL/SQL is a third generation language (3GL), or at least the PL-part is, where you describe how things should be processed. Leading to more code and more control. With every Oracle release, SQL becomes more powerful and the optimizer gets better, so using SQL is increasingly important.
    For complex processing, using PL/SQL is still necessary. But use it with care.
    Hope this helps.
    Regards,
    Rob.

  • Could you please answer this questions ?

    could you please answer this questions ......
    2. What can you do with the DBMS_LOB package?
    A. Use the DBMS_LOB.WRITE procedure to write data to a BFILE.
    B. Use the DBMS_LOB.BFILENAME function to locate an external BFILE.
    C. Use the DBMS_LOB.FILEEXISTS function to find the location of a BFILE.
    D. Use the DBMS_LOB.FILECLOSE procedure to close the file being accessed.
    3. Which two statements about packages are true? (Choose two)
    A. Packages can be nested.
    B. You can pass parameters to packages.
    C. A package is loaded into memory each time it is invoked.
    D. The contents of packages can be shared by many applications.
    E. You can achieve information hiding by making package constructs private.
    4. Which three are true statements about dependent objects? (Choose three)
    A. Invalid objects cannot be described.
    B. An object with status of invalid cannot be a referenced object.
    C. The Oracle server automatically records dependencies among objects.
    D. All schema objects have a status that is recorded in the data dictionary.
    E. You can view whether an object is valid or invalid in the USER_STATUS data dictionary view.
    F. You can view whether an object is valid or invalid in the USER_OBJECTS data dictionary view.
    5. You need to create a stored procedure, which deletes rows from a table. The name of the table from which the rows are to be deleted is unknown until run time. Which method do you implement while creating such a procedure?
    A. Use SQL command delete in the procedure to delete the rows.
    B. Use DBMS_SQL packaged routines in the procedure to delete the rows.
    C. Use DBMS_DML packaged routines in the procedure to delete the rows.
    D. Use DBMSDELETE packaged routines in the procedure to delete the rows.
    E. You cannot have a delete statement without providing a table name before compile time.
    6. You need to drop a table from within a stored procedure. How do you implement this?
    A. You cannot drop a table from a stored procedure.
    B. Use the DROP command in the procedure to drop the table.
    C. Use the DBMS_DDL packaged routines in the procedure to drop the table.
    D. Use the DBMS_SQL packaged routines in the procedure to drop the table.
    E. Use the DBMS_DROP packaged routines in the procedure to drop the table.
    7. When using a packaged function in a query, what is true?
    A. The COMMIT and ROLLBACK commands are allowed in the packaged function.
    B. You cannot use packaged functions in a query statement.
    C. The packaged function cannot execute an INSERT, UPDATE, or DELETE statement against the table that is being queried.
    D. The packaged function can execute and INSERT, UPDATE, or DELETE statement against the table that is being queried if it is used in a subquery.
    E. The packaged function can execute an INSERT, UPDATEM or DELETE statement against the table that is being queried if the pragma RESTRICT REFERENCE is used.

    It should be good if you try yourself by training your brain to solve these questions and then share them with us to get more help or advice
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com

  • Some one please answer this, every time i go into application loader it says, application failed codesign verification go into application loader and try to publish a app it says, please go into depth im a beginner, and use gamesalad

    some one please answer this, every time i go into application loader it says, application failed codesign verification , please go into depth im a beginner, and only use gamesalad please respond as soon as possible!   

    yes i did sorry for the late response LOL plus it was just a minor error! Just check to make sure u have all of ur correct distribution/developer/and creator certificates in your keychain access installed and up-to-date! Plus i have had over 900 downloads on that game!! ^^
    -CHEERS /RYAN

  • Satus bar, please answer this question. thanks

    Which of the following is not seen by the user normally in the status bar of the
    SAP screen
    a. client number/id
    b. session number
    c. data server name/id
    d. user id/name
    e. information, error, and warming messages

    " then why have the £2.99 apps not changed prices? "
    The app developers and Apple can choose to price their product however they like.  Reasons could be market conditions, costs ( legal, taxes, structure, licensing,etc), simple profit strategy, market positioning, etc.  They could just decide that they need more profit.  All businesses have this freedom and exercise it.
    "Looks to me as if I'm getting ripped off. "
    Not any more that with any other product or service you buy.  Everyone prices their product/service as they see fit.  the consumer can then deice to purchase or not.
    "Can you guys at Apple please answer this question? "
    No.  Apple will not respond to you here at all.  This is a user forum.
    They certainly will not explain their pricing strategy to your in any case, just as most any other company does not.

  • HT3523 what does the meaning of "you need to install additional software to open this type of file." did i have to upgrade it or compressed the video or i have to upgrade my macbook? please answer this question. thank you :)

    please answer this question because i can't upload my video cause i can't open it. sooo please answer this question. i'm using macbook white the latest version.

    i had the same problem and i fix it installing ccleaner, it is free and an excellent program. You can download it from: https://www.piriform.com/ccleaner/download
    Once installed, in the tab "Herramientas" (sorry but i have it in spanish) you choose "Inicio" and them you pick CS5ServiceManager then you pick in delete option. Basically you are removing of the startup programs...
    Hoping to be helpful, and excuse my bad english!

  • LSMW Please answer this query Experts

    Hi all,
    I Know how to use LSMW and upload data . Now I am trying to upload data for xk01 uisng lsmw. SO, the problem is vendor number uses internal assignment here. I don't know wether we use lsmw if lifnr uses internal assignment.Also I need to upload bank details for each vendor which are in a seperate flat file. Guys with real time experience, I think can solve this problem. Please guide me with this.
    Regards,
    Varun.

    You already have another post with the same question. Can you please close this one?

  • "BASIC QUESTION" !PLEASE ANSWER THIS BASIC QUESTION !

    HI EVRYONE!
    I AM AN ENGG. STUDENT N JST STARTED WITH ORACLE SQL. I HAVE A QUESTION--"IS "TAB" TABLE A MASTER TABLE?AND ARE THE TABLES,THAT WE CREATE UNDER "TAB" TABLE, THE ROWS OF "TAB" TABLE?"..OR IT CAN BE PUT LIKE "CAN WE CALL THE Tables created inside tab as rows of tab table?"...please answer ....i need it badly!! :(

    user8979199 wrote:
    HI EVRYONE!
    I AM AN ENGG. STUDENT N JST STARTED WITH ORACLE SQL. I HAVE A QUESTION--"IS "TAB" TABLE A MASTER TABLE?{code}
    SQL> select * from all_objects where object_name = 'TAB';
    OWNER OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
    SYS TAB 2566 VIEW
    PUBLIC TAB 2568 SYNONYM
    SQL>
    {code}
    As you can see TAB is a *view* that is owned by the SYS user and is actually a view on the data dictionary of the database.
    AND ARE THE TABLES,THAT WE CREATE UNDER "TAB" TABLE, THE ROWS OF "TAB" TABLE?"..OR IT CAN BE PUT LIKE "CAN WE CALL THE Tables created inside tab as rows of tab table?"You don't create tables under the TAB view. You create tables in your schema and the TAB view will show you the tables that exist/are owned by your schema.
    The view, as with any view, when queried, returns rows showing the table names.
    ...please answer ....i need it badly!! :(Everyone wants their question answering. Why should your question take any priority over anybody elses, just because you want it badly. I'm sure if we asked the other people with questions they would also like an answer badly, but they aren't so rude as to expect people drop their own work just for them. Please don't ask questions in that manner again.

  • I have Lost my iphone particularly it is stolen other than local police station does apples service center or premium reseller can do my help??I mean does Apple service center helps us?? Please answer this ASAP

    My iPhone is stolen I need Help in answer the following question other than Local police station does Apple Service center or premium reseller does our Help
    Please answer it ASAP

    No, they will not help. You need to have Find My iPhone activated on the phone prior to the loss/theft and then you can track the device at www.icloud.com. If you did not activate Find My iPhone, then there is no way to track the device. If the device did not have a passcode on it, immediately change the passwords of all accounts you have on the phone; mail, banks, credit cards, etc.

  • Hi please answer this questions asap

    Hi
        At present in banner  i have  a label like  EIN :12  ( iddesc, idno) like this,
        at present EMPID  is coming from different BAPI, full description for that ein
      is Employeee Idenfication Number  that full description is coming from another
      BAPI.
    Problem is   i need to display full description instead of EIN.   for that i tried
    the following code,  but it is throwing null pointer exception, plz check the code.
              IModifiableSimpleValueSet dropValueSet;
              IWDAttributeInfo loc_AttributeInfo     = wdContext.nodeBanner().getNodeInfo().getAttribute("IDType1_Desc");
              dropValueSet                              = loc_AttributeInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
              int nodeSize                               = wdContext.nodeBanner().size();
               dropValueSet.clear();
               dropValueSet.put("0","Select");
               for(int i=0;i<nodeSize;i++){
               dropValueSet.put(wdContext.nodeBanner().getElementAt(i).getAttributeAsText("IDType1_Desc"),wdContext.nodeBanner().getElementAt(i).getAttributeAsText("iD_DESCRIPTION"));
    For every useful answer i will reward nice points.  Please reply asap.
    regards
    jalandhar

    Hi
    To check the cardinality properties.Go to the Comp Controller or Custom Controller Context ,Right click your node and select the properties.You can now see the cardinality properties also.Change those.Your data is coming from 2 Bapis so in your used models declare the Model usages also.In the View Properties Declare the Component or Custom Controller usage whose context is binded with model.
    Better you create 2 Nodes in the context each for getting the data from Different Model.So confusion in usage.
    regards
    venkata kalyan

  • For the love of all that is holy, will someone please answer this

    I have a 1GB ipod i bought a year ago, the software that came with it was itunes and it worked good. I could see a list of all the songs on my ipod in itunes when i connected it. then:
    My niece got an ipod shuffle for christmas and she wanted me to charge it and put songs on it for her. The itunes told me i needed a newer version so i downloaded that and installed it. Now, when i plug in MY ipod, i cannot see my songs. also, it erases my ipod when i plug it in and puts her songs on it. then, when i put my songs back in it and later plug in hers, it erases her songs and fills it with mine. It is driving me crazy. can someone please help me figure out why i cannot see my songs on my ipod but i CAN see the songs on hers? And how do i stop this infernal software from erasing the ipods? PLEASE EMAIL YOUR ANSWER TO ME [email protected] I DO NOT KNOW HOW TO GO VIEW YOUR ANSWER

    Yes, that is where to look. However, I don't have a method for you.
    But it is possible to insert a graphic into a PS document (in this case a menu) that is larger than the image/layer size. I just put such a graphic (a simple rectangle 15 x 10,000 pixels). You only see the layer size (1920x1080), but if I drag that graphic to a 500x10,500 document, you can see that the whole graphic was in a layer in the EN menu.
    I don't know how to find the size of a graphic element that is larger than the PS document nor how to see whether a graphic extends beyond the document.
    Do you recall adding something that might have been large? Let's see if someone can tell us. (Or you can ask in the PS forum) If nothing else, I would reconstruct the menu and pay careful attention to what I am adding.
    I have not experienced this error and cannot guarantee that this is your problem.

  • OMG CAN SOMEONE PLEASE ANSWER THIS I REALLY NEED HELP!! MY ITUNES WONT OPEN

    i had to download itunes again because i restarted my computer and deleted itunes from it and i downloaded the new itunes and everything was goin good and it got intalled and the quicktime and itunes icons appeared on my desktop...but when i clicked on the icon 2 open itunes the iTunes Software License agreement poped up quikly and disappeared and everytime i click on itunes it pops up and then goes away and im not able to click the agree button....i have restarted my computer completly so dat it can start fresh and then i download itune but the same thing keeps happenin....omg please help me...this problem has me frustrated i dont know wat to do anymore

    Any help here?
    http://docs.info.apple.com/article.html?artnum=302386

  • Could you please answer this questions. experts

    what is the use of cell editor?
    what are the sequence of operations carried out when transpoting object?
    why we use navigational attributes ?please elaborate

    hi..
    navigational attrib:
    From a system performance point of view, you should model an object on a characteristic rather than on a navigation attribute. The reasons for this are as follows:
    ·        In the enhanced star schema of an InfoCube, navigation attributes lie one join further out than characteristics. This means that a query with a navigation attribute has to run an additional join (compared with a query with the same object as a characteristic) in order to arrive at the values. This is also true for ODS objects.
    ·        For the same reason, in some situations, restrictions for particular values in the navigation attribute (values that have been defined in the query) are not taken into account by the database optimizer when run schedules are created. This can result in inefficient run schedules, particularly if the restrictions are very selective. In most cases, you can solve this problem by indexing the navigation attribute in the corresponding master data tables (see below.)
    ·        If a navigation attribute is used in an aggregate, this aggregate has to be adjusted using a change run as soon as new values are loaded for the navigation attribute (when master data for the characteristic belonging to the navigation attribute is loaded.) This change run is usually one of the processes that are critical to the system performance of a production BW system. This is why, by avoiding using navigation attributes or not using navigation attributes in aggregates, you can improve the performance of this process. On the other hand, not using navigation attributes in aggregates can lead to poor query response times. The data modeler needs to find the right balance.
    BEx Cell Editor: In queries with two structures, you can now reference cells at the intersections of rows and columns.
    chk this link for transportation:
    http://help.sap.com/saphelp_nw04/helpdata/en/0b/5ee7377a98c17fe10000009b38f842/content.htm
    hope it helps..
    all the best...

  • Deployment failed error - need of five star - please answer this

    Dear All ,
    One of 100 error iam facing daily on LV 8.0
    I have made my project in my laptop and started the application  it work fine in laptop .
    but same .lvlib file i have transfered to server (only modification i did is in the shared variable) iam receiveing deployment failed error .
    Please find the attachment and give some hint to solve this problem.
    Attachments:
    deployment error.jpg ‏74 KB

    ramji,
    I think the following kb How Do I Deploy Network Shared Variables From a Compiled Executable? may provide some help. When building your executable, make sure you include your lvlib that contains yoru shared variable in the "support files" section of the application builder. Also, try including your lvlib in the data directory instead of the actually exe itself. Let us know. thanks!
    Chris c
    Chris Cilino
    National Instruments
    LabVIEW Product Marketing Manager
    Certified LabVIEW Architect

Maybe you are looking for

  • How to read outlook mailbox and create corresponding e-mail activities in CRM

    On premises CRM 2013 SP1: current configuration for incoming and outgoing: all of the users in our organization use Microsoft Dynamics CRM for Outlook as the incoming and The E-mail Router is used to send outgoing e-mail that users create in Microsof

  • Transfer Cost center stock into Own

    Dear all, Material procured against cost center and GRN made accordingly (Cost center). Out of these stocks partial goods issues also done. Now the remaining stock (showing in cost center) want to take into own stocks i.e Cost center stock to Own sto

  • Video frame won't open in Photoshop CS6

    I recently upgraded to CS6 and am having a problem with Photoshop. In my previous version (CS5.1) I could drag a single frame of video from a .mov file and drop it onto my Photoshop icon and Photoshop would open that frame as new document. But now in

  • Site-specific error pages do not render images?

    A weird one, but here goes..... Does anyone have any idea why our site specific error pages (Network Error, Site Busy Error...) would not serve images? Our custom HTML and pages appear as desired, but our logo and other .gifs do not and appear broken

  • Error with patching Oracle DB 11.1.0.6 (Patch 10 - 7378392)

    Hi, I am getting an error when trying to appy the patch 7378392 on Oracle DB 11g. I am using the command opatch appy It worked great with other patches. What am I doing wrong? Best regards, Dejan Invoking OPatch 11.1.0.6.0 Oracle Interim Patch Instal