J-CONTENTS & INCREMENT OPERATOR

I have 2-questions:-
1. What are the contents of Core Java & Adv. Java?
Is swing part of Core Java OR Adv. Java?
2. Let int a=1;
after execution of statement a=a+++a+a++; value of a will be 5
after execution of statement a=++a+a+a++; vaue of a will be 6
after execution of statement a=a+a+++a++; value of a will be 4
Please Explaine me the logic behind it.
Thanks & Regards,
GAJESH TRIPATHI
09252708020

gajesh wrote:
I have 2-questions:-
1. What are the contents of Core Java & Adv. Java?
Is swing part of Core Java OR Adv. Java?Huh? There is no official "core" vs. "advanced" (which is what I assume you mean by "adv"). Swing is part of the core API.
2. Let int a=1;
after execution of statement a=a+++a+a++; value of a will be 5
after execution of statement a=++a+a+a++; vaue of a will be 6
after execution of statement a=a+a+++a++; value of a will be 4
Please Explaine me the logic behind it.No. That's ridiculous code. You'll never see that for real.
Instead just learn about the difference between pre-increment (++x) and post-increment (x++).
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/op1.html

Similar Messages

  • Post Increment Operator Question

    I had written a small program to test the working of Post increment operator.
    public static void main(String[] args)
         int a = 4;
         a = a++;
         System.out.println ( a );
    I expected the output to be '5', but the output given is '4'.
    Can anyone tell me to how this works in Java ?

    There is a big difference between a++ and ++a.
    a++ means increment a AFTER you have performed the line.
    ++a mean increment a BEFORE you perform the line.
    class Test
    public static void main(String[] args)
    int a = 4;
    a = ++a; //returns a = 5
    // a = a++; //returns a = 4
    //a++; //returns a = 5
    //++a; //returns a = 5
    System.out.println ( a );
    }

  • Can't View Flash Content in Opera 9

    Hello,
    I'm having viewing Flash content with Opera 9. I have downloaded and installed the latest version of Flash (9.0.18), and my other browsers have no problem showing the Flash content.
    Am I missing something here with getting Opera 9 to display Flash movies, etc.? I can't figure out how to instruct the browser to display it.
    Many thanks,
    sarah

    Sheeesh, fixed it.
    Open Opera 9 Preferences
    Click the Advanced Tab at the top
    Select Downloads in the left column, you will get a Mime type window
    Scroll and find .swf extension then click Edit
    At the bottom of the window that opens it should be checked "Use plug-in" and show Shockwave Flash
    Select Shockwave Flash and you will see another one listed as well, swap to it and restart Opera.
    Somehow, even though I did uninstall all older components, it's found and used the wrong one.
    Now Flash works fine in Opera 9, Safari and Firefox.

  • Blocking all flash content with Opera

    Hi!
    How can I block all flash content except Youtube with Opera?
    Do you know any system wide methods to block flash (except youtube)?
    cheers

    Press F12 (or "Tools > Quick Preferences") and disable plug-ins. Then go to youtube.com, right-click and choose "Edit Site preferences". Add youtube.com (delete the www.) and enable plug-ins on the Content tab.
    Not all flash content on Youtube comes from youtube.com, so you probably have to create more exceptions over time.
    Last edited by byte (2008-10-03 16:25:52)

  • Transactionality in Content Management Operations

    We're using WebLogic Portal 10.3's built-in content management mechanism backed by Oracle 10g. A lot of our use cases involve the creation of more than one node within a single service call (creating a document and multiple links to it, for example).
    If possible, we'd like to rollback previous creates if a later create fails. Worst case scenario we can use compensating transactions to delete the new nodes, but it would be nice to have it automatically.
    Does INodeManager.addNode respect transaction boundaries? Or do we need to go the compensating transaction route?
    Thanks for the help,
    Dan Turkenkopf

    Hi Dan,
    The answer is repository-specific. The OOTB repository doesn't support user-transactions and you'll likely run into database locking issues if you try. You'll have to handle this case on your own.
    -Ryan

  • E72 - flash content in opera mini

    i cant view any flash in opera mini, it says flash player not installed. when i try to install flash player it says unable to install component built in. i found out that it has already flash lite 3 installed, but how i can use it with opera?

    have you tried the latest opera?
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • Post increment operator i++

    I can't seem to figure out why the following is outputting 2,2,3 and not 2,3,4. Having searched the Java Language Spec and reading ... (http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#39438)
    ... it is still not clear. The key line probably is "The value of the postfix increment expression is the value of the variable before the new value is stored." I still think that the second output should have been 3 and not 2. Could someone explain this to me? Thanks.
    Here is the code that I tried:
    int i;
    i = 2;
    System.out.println(i);
    i = i++; // the line which I don't understand
    System.out.println(i);
    i++;
    System.out.println(i);

    The key is to understand the difference between the
    value of the expression and the value of the
    variable.
    i = i++;What that particular bit of devil-spawn does is
    this:
    1) Get the current value of i. The value of the
    postfix increment expression is the value of the
    variable before the new value is stored. So we
    have to get the "before it's incremented" value. This
    is the value of the expression i++.
    2) Increment i. This doesn't alter the value of the
    expression that was obtained in step 1.
    3) Take the value of the expression that was
    retrieved in step 1 (the value of i before being
    incremented) and stuff it into i.
    If you had int i = 2;
    int j;
    j = i++; Would you expect j to be 2 or 3? It will be 2. And
    the same reason that j is 2 here makes i 2 if you put
    i on the left of the equals.When the expression is "i = i + 1" compiled, it should be divided into two sub expressions :
    1.) i = i; //As postfix defination says use value first and then increment
    2)i = i + 1//Increment i;
    so, accordingly, the value of i after first step should be 0 and then after second step it is 1(C,C++ behaviour).
    so, the statement i = i++ must result into the value 1 for i, not 0.
    even in C#.net the value of i is 0 after the execution of above statement.

  • Increment operator

    hi
    i have a small code snippet
    int i=10;
    i=i++;
    System.out.println(i);as per my knowledge it should result *11*, but it gives *10*,
    could you please tell me the reason for this why it is so ?
    ashish

    In contrary to C or C++, the meaning of i=i++ is well defined in Java.
    It is better avoided though!
    This i=i++ stuff gets regularly discussed.
    http://forums.sun.com/thread.jspa?threadID=231270&tstart=122941
    http://forums.sun.com/thread.jspa?threadID=441193&tstart=72796

  • Unable to edit ReadItem and ReadList operations on one specific external content type

    I'm experiencing a strange behavior.  Here is the scenario:
    - In Sharepoint Designer I create external content type A that uses external system X
    - I define ReadItem and ReadList operations for this external content type
    - I then create external content B that uses the exact same external system X and define ReadItem and ReadList operations for this external content type
    - I then go back to external content type A, select ReadList and click Edit This Operation
    - I get a message : "This operation cannot be matched with any objects in your data source.  There may be an error in the operation definition in Business Data Connectivity Metadata Store or the data source schema has changed since the operation
    was created"
    - I tried to edit ReadList operation of external content type B and it works with no problems.
    - so I delete the ReadItem and ReadList operations for external content type A, refresh external system X, and then recreate the ReadItem and ReadList operations for external content type A. 
    - When I try to edit the ReadList (or ReadItem) operation I get the same error message and I'm not able to edit this operation.
    This used to work a week or so ago, meaning that I was able to edit the ReadItem and ReadList operations for both external content types.  Now, the operations cannot be edited anymore for external content type A but can be edited with no problems for
    external content type B.  For content type A, if I want to make any changes I have to delete the ReadItem and ReadList operations and recreate them.  Does anybody have any idea as to what the problem might be?  These two external content types
    use the same external system which is a table of employees and project they worked on.  The only difference is that external content type A has a filter by employee ID defined and external content type B has a filter by project ID defined.
    thanks,

    Hi bbatl,
    I did a test as the followigs:
    Open SQL Management Studio, create a table containing a filed called “employee ID” and a filed called “project ID”.
    Add some data into the table.
    Open my site with SharePoint Designer 2010, create a new external content type called TestA.
    Connect the external content type TestA to the table that I created in step 1.
    Create Read Item and Read List operations in the content type. When creating Read List operation, add a filter based on “employee ID”.
    Click Save.
    Create another external content type called TestB
    Connect the external content type TestB to the table which was created in step 1.
    Create Read Item and Read List operations in the content type. When creating Read List operation, add a filter based on “project ID”.
    Click Save.
    Then I went back to edit the Read List operation of external content type TestA via clicking Read List operation under External Content Type operations->Edit Operation.
    No error displayed.
    So, I could not reproduce this issue.
    Whether you got the error when you clicked “Edit Operation” in SharePoint Designer. Please provide a screenshot about this issue.
    Please check whether someone has changed the table special for the column “employee ID”.
    And whether you have created an external list using the problematic external content type. If yes, please check whether it could work well.
    Best Regards,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Behaviour of post increment/decrement operator

    int i = 1;
    i = ++i;
    System.out.println( i ); //output is 2
    i = i++;
    System.out.println( i ); // output is 2, WHY?

    Well, it seems that you didn't get the point at all.
    I know how to do the increment operation. What I
    intended to know is the behavior in this scenario.
    And you got that in reply 2.I assumed the answer to be that. but i was only trying to be sure.
    I know that such codes r not in common use and they are meaningless too, but such codes do come up in various quizzes, etc. to test ur knowledge. we always learn WHAT not to do, but we seldom try to know WHY not to do it. in our endeavor to learn advanced topics we tend to ignore the basics.
    Coming back to the original code can someone tell me whether this is a well defined behavior unlike c/c++ where the behavior of such codes are undefined. as far as i know java is a strongly typed language, where ambiguities have been eliminated (believe i am not wrong on this). Can i expect the same results on all compilers??
    and i hope that the forum behaves in a sane manner in future. Instead of blatantly dismissing a post, let people give reasons for it.
    Thanks

  • Operator precedence: prefix vs postfix incremental

    Hello pal,
    I am confused whether postfix incremental operator has more precedence that the prefix incremental operator or not.
    The following URL shows that postfix incremental operator has superior precedence.
    http://java.sun.com/docs/books/tutorial/java/nutsandbolts/expressions.html
    I wrote a simple program to test the concept,however, it looks like they have equal precedence.
    public class Precedence {
            public static void main(String[] args) {
                    int i, k;
                    k = 10;
                    i = ++k * k++;
                    System.out.println("k = 10;");
                    System.out.println("i = ++k * k++;" + " = " + i);
                    k = 10;
                    i = k++ * ++k;
                    System.out.println("k = 10;");
                    System.out.println("i = k++ * ++k;" + " = " + i);
    }The output surprises me, though. (Note that I run the program on IBM JRE 1.3.1 build cn131w-20020403 ORB130.)
    k = 10;
    i = ++k * k++; = 121
    k = 10;
    i = k++ * ++k; = 120
    Question: Is this a correct behaviour ... or my test program is wrong?

    Yes, this is correct behavior.
    k = 10;
    i = ++k * k++;
    ++k is incremented to 11, but k++ is not because its a postfix increment, it is assigned after i. So this ends up being 11 * 11 which gets you 121.
    k = 10;
    i = k++ * ++k;
    k++ is assign after the operator, so it remains 10. ++k is a prefix increment, so this becomes 11, but the postfix increment makes it 12. So this ends up being 10 * 12, which becomes 120.
    It all makes sense if you look at this code. It's actually what's happening:
    public class Precedence {
            public static void main(String[] args) {
                    int i, k, j;
                    j = 0;
                    k = 10;
                    i = ++k;
                    i = i * k++;
                    System.out.println("k = 10;");
                    System.out.println("i = ++k * k++;" + " = " + i);
                    k = 10;
                    i = k++;
                    i = i * ++k;
                    System.out.println("k = 10;");
                    System.out.println("i = k++ * ++k;" + " = " + i);

  • Search Incremental Crawl is not getting triggered at the scheduled time.

    Hello All,
    Since 1 week i am observing that the incremental crawl is not getting triggered on the scheduled day & time but the next schedule is moving to next day. Let me put down in a detail.
    Content Incremental crawl is scheduled to run daily at 5.00 PM CST. Last 3 days i checked at 5.30 PM CST and found that the incremental crawl is not triggered and the status is Idle. But i noticed that the Next incremental crawl date is moved to next day
    at the same time.
    Can some one help me out how to get out of this issue. Thank You!

    Hi,
    Did you check the crawl logs? Please post here any error message that you come across in Crawl logs.
    Also, does crawl operations are performed when you crawl manually?If yes, have a look at steps below:
    Possible Cause:
    Folder %WinDir%\Tasks is not added with SharePoint Local group WSS_WPG Where Indexer is Running
    Resulution:
    1. Login to the SharePoint Indexer machine with account which has Administrative previlages
    2. Open Command prompt and run the command attrib –s %windir%\tasks.
    %Windir% is the Default installation of Windows
    3. Open Windows Explorer and go to the %Windir%\Tasks folder And open the properties of the Tasks folder
    4. Click the Security tab and Check whether we have WSS_WPG, If it is not there Add the Group with Full Read and Write permissions
    5. Now Open IIS Manager and restrat IIS or at the command prompt Type IISRESET so that the Chages will take place.
    6. From the command prompt Run the command attrib +s %windir%\tasks so that the view goes back to default
    7. Do the above Steps on all the SharePoint servers in the Farm
    Ref: http://blogs.msdn.com/b/vrajas/archive/2012/02/08/moss-2007-schedule-crawls-are-not-starting-automatically.aspx
    Hope it helps!
    Thanks,
    Avni Bhatt
    If this helped you resolve your issue, please mark it Answered

  • SP 2013 ECT - Created an External Content Type in SPD But Not Appearing in BCS

    Hello Community,
    I have created an External Content Type in SP Designer 2013, and the connection and operations all seem to work fine, but the ECT List throws an access error, and when I check the BCS Service Application the ECT doesn't even appear in the list.  Has
    anyone else ever seen this kind of problem and if so please brovide guidance and examples for resolving it.
    Thanks!
    Tom
    Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award -
    Linked-In - SharePoint Gypsy

    Hi Tom,
    Have you created external content type from SharePoint designer 2013 successfully prevously?
    And was it displayed in BCS service applicaiton previously?
    Have you executed "External Content Type Operations" and saved it back successfully in SharPoint Designer like the following article?
    Please check if it is related to the permission issue by using SharePoint Farm Administrator account to create this external content type.
    If all above don't solve the issue, please check the ULS log for more information for troubleshooting when create the external content type.
    http://www.c-sharpcorner.com/UploadFile/anavijai/create-external-content-type-using-sharepoint-designer-2013/
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Daniel Yang
    TechNet Community Support

  • Rename columns of list created by external content type in share point 2010

    Hi,
    I want to rename columns of list created by external content type.
    Please help to solve the issue.
    Thanks in advance!
    Regards
    Rajni

    Hi,
    Steps to rename column name:
    Open external content type in SharePoint designer
    click on “Operations Design View” from ribbon
    select corresponding external content type operations
    click on edit operation from ribbon
    click next button to get the Return parameter configuration page
    select the parameter and change the display name from the properties
    Anandhan.S Remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

  • Web content viewer - supported features

    Hello,
    Does anyone knows which DPS functionalities are supported in web viewer.
    I'm in trouble to get the following working:
    - scrollable content
    - MSO operating buttons
    - images sequences
    videos and navto buttons work fine.

    Hello,
    I upgraded today to Drop 21 tools and created a new custom content viewer to test my folio on iPad.
    After re-publishing the whole folio, I can view it again in Web Viewer ("Adobe Content Viewer for Web").
    A few problems remain:
    - Images sequences not working (seems that they should, see bottom of the page)
    - embedded (in MSO) buttons (leading to prev/next state) not working
    What can I do now?
    I've got on a page a 5 states MSO.
    Each state contains next/prev/close buttons
    States 3,4,5 contain an "auto launch" image sequence.
    Everything works fine on iPad, of course
    An idea, anyone?

Maybe you are looking for

  • Can I move photos from my ipod to my computer?

    I recently reformatted my computer. after I restored my documents half of my photos are missing. They are all on my ipod can I move these photos back to my computer? I am afraid that if I sync the ipod to the computer they will disappear.

  • My iMac freezes and makes loud bleeps!

    Hello Having major problems - my iMac keeps freezing and plays beeps (3 at a time) so I have to force shut down. Is it anything to do with Lion? I installed it recently. It's an iMac 3.6 core i5 with 8gb or ram, around 8 months old. Hope you can help

  • Problem to weblogic start managed server "OraSDP"

    Hi all, first, sorry if this location is not correct to this thread. I have a problem when I start a weblogic managed server, which indicates there is an error to check a QueueConnectionFactory into JNDI. The log of this error is next: <16-feb-2011 1

  • How do you change the start up color

    I dont knoow how I did it but the start up color has gone from gray to a pink  - Very hard on my old eyes

  • VC Chart Event Handling

    I have a VC Chart which has Input as BW Query also the chart output connected with another BW Query and a 2nd chart for the output, I am passing the selected values in the chart-1 to BWQuery-2 for Chart-2. When Chart-1 loads it is triggered with a EV