Why is there no error ????

Hi,
This is from my sourcecode:
public aj_List mergeSort (aj_List l){
     int m=l.size()/2;
     if(l.size()>2){
     aj_List l1=divide(l,0,m-1);
     aj_List l2=divide(l,m,l.size()-1);
     mergeSort(l1);
     mergeSort(l2);
     }else{ ...........................
The function has the return type "aj_List", but I can call the funktion without doing this:
a1,a2 are from type aj_List:
a1 = mergeSort(l1);
a2 = mergeSort(l2);
this works too!
Normally I get a error when trying to compile this. But there not. I do not why both implementations are allowed. Should be not, or ?

Hard to understand the question but I think you want to know why both of the following are legal
mergeSort(l1);
a1 = mergeSort(l1);
Basically because java allows the return value to be thrown away. It still exists for a short time, but you just don't use it.

Similar Messages

  • Why is there a error appearing in this??

    I have written a program to search if the particular item is present in the file or not.. so why is there any error hope it is right!
    BufferedReader check;
         try{
             check=new BufferedReader(new FileReader(FileName));
        }catch(FileNotFoundException ex){
            System.out.println("Sorry file not found");
            return; 
                                System.out.println("Enter the item to be found");
                                String input_item=in.readLine();
                                String item= input_item.toUpperCase();
                                System.out.println("Searching for "+item);
                                int messenger=0, x=0;
                                 while(x<sType.length) {
                                    sType[x]=check.readLine();
                                    sNum[x]=Integer.parseInt(check.readLine());
                                    sPrice[x]=Float.parseFloat(check.readLine());
                                    if(item.equals(sType[x])) {
                                        System.out.println("Found "+sType[x]);
                                        System.out.println("-------------------------------------------------------");
                                        System.out.print("Stock Name :");
                                        System.out.println("\t"+sType[x]);
                                        System.out.print("Stock Level:");
                                        System.out.println("\t"+sNum[x]);
                                        System.out.print("Stock Price:");   
                                        System.out.println("\t$"+sPrice[x]);
                                        System.out.println("-------------------------------------------------------");
                                        messenger=1;
                                    x++;
                                if(messenger==0) {
                                    System.out.println("Sorry "+item+" not available");
      and the file contains the following in the particular format
    LOGITECH CORDLESS DESKTOP LX300
    200
    50.2
    MONITER
    62
    54.9
    PANASONIC
    54
    32.3
    MOUSE
    95
    21.4pl help why this error is appearing???
    Exception in thread "main" java.lang.NumberFormatException: null
    at java.lang.Integer.parseInt(Integer.java:415)
    at java.lang.Integer.parseInt(Integer.java:497)
    at programname.<init>(NewMain.java:17)
    ??????????????????????????????????????????????????????

    Please do not post the same question more than once!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    http://forum.java.sun.com/thread.jspa?messageID=9919410

  • TS3694 why is there an error 9006 and how can i fix it?? please answer for ipad mini

    why is there an error 9006 and how can i fix it?? please answer and btw its an ipad mini

    if you are trying to download and install ios7, it is probably because of the enormous amount of traffic apple's download servers must be experiencing. things should return to normal before too long, just hang tight

  • HT201210 why is there an error occurring when trying to do a software update ios6 on iphone 4s

    why is there an error occurring when trying to do a software update ios6 on iphone 4s??

    You might find this article helpful: http://support.apple.com/kb/TS3694
    It has the error range of 3000's which states
    Errors 3000-3999 (3002, 3004, 3013, 3014, 3018, 3164, 3194, and so on): Error codes in the 3000 range generally mean that iTunes cannot contact the gs.apple.com server on ports 80 or 443. This may be because out-of-date or incorrectly configured security or firewall software is interfering, an old version of iTunes is installed, an entry in your hosts file redirecting requests to gs.apple.com (see error 1004 above), or because of your Internet proxy settings. If you are using a proxy, try without using one or with a known-good network. If that does not resolve the issue, follow iTunes for Windows: Troubleshooting security software issues. Error 3014 may indicate that you need to free up more disk space on the computer before trying to restore again. Error 3194 most likely indicates you do not have the latest version of iTunes installed Update to the latest version of iTunes. 

  • Why is there the error "The requested protocol does not exist comm:0" ?

    Hi all,
    I want to read data from a USB serial port of the mobile phone ( Alcatel OT-806D ). The cable connects the phone and the computer. The system running in the PC is Windows XP. I launch a java j2se program which writes a number to the usb serial port. And in my midlet I run a j2me which will read on the usb port. The problem is that the output displayed in the item on my midlet is "The requested protocol does not exist comm:0". So why there is this error , and how to correct it ?
    Thank you very much

    only protocol required to be suppoted by a j2me mobile device is http://: some vendors to implement more protcols like socket:// but this depends on the vendor...

  • Why is there no error at checkout, but it insists there is, why is there no error at checkout, but it insists there is

    i tried to buy something on itunes, but when i added money to my account, it for some reason doesn't recognize any method i choose, but there are no errors, i have gift cards entered and they show on my account, but i can't even use those.

    We don't work for Apple, so how do you expect anyone here to know the reason why?

  • Flash is complaining about XML? Im using AS3 why are there XML errors? Unknown syntax errors.

    Sorry to keep spamming these forums with my stupid errors, but I am trying really hard to learn Flash/AS3 and when I have got to grips with it, I will return the love.
    I am a flash rookie trying to make a simple calculation device and I am getting a whole world of errors I have never seen before.
    My Code (I apologise but it may be my bad syntax):
    import flash.ui.Mouse;
    var Hnum:String;
    var PCnum:String;
    var calc:Number = 25;
    var Total:Number;
    num1.restrict = "0-9";
    num2.restrict = "0-9";
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function PartCount(event:MouseEvent):void{
        PCnum = num2.text;
        if (PCnum > 0 && < 10){
            parseInt(PCnum) * 10;
        or if (PCnum > 11 && < 20){
            parseInt(PCnum) * 5;
        or if (PCnum > 21){
            parseInt(PCnum) * 1;
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function calculate(event:MouseEvent):void{
        Hnum = num1.text;
        PCnum = num2.text;
        Total = parseInt(Hnum) * calc + parseInt(PCnum);
        Total.toString();
        Total_txt.text = String(Total);
    I had everything working when I was only calculating Hnum by 25. But when I try to intergrate  the if or statement everything goes wrong and I get these 5 errors.
    Scene 1, Layer 'Actions', Frame 1, Line 15
    1104: invalid xml name
    Scene 1, Layer 'Actions', Frame 1
    1084: Syntax error: expecting xmltagendend before end of program.
    Scene 1, Layer 'Actions', Frame 1
    1084: Syntax error: expecting rightparen before end of program.
    Scene 1, Layer 'Actions', Frame 1
    1084: Syntax error: expecting identifier before end of program.
    Scene 1, Layer 'Actions', Frame 1
    1084: Syntax error: expecting rightbrace before end of program.
    I dont understand what these errors are pointing out? Why XML? is it my variable names?
    Here is the code I had before the second function that worked fine:
    var Hnum:String;
    var PCnum:String;
    var calc:Number = 25;
    var Total:Number;
    num1.restrict = "0-9";
    num2.restrict = "0-9";
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function calculate(event:MouseEvent):void{
         Hnum = num1.text;
         PCnum = num2.text;
         Total = parseInt(Hnum) * calc;
         Total.toString();
         Total_txt.text = String(Total);
    Any help would be greatly appreciated! I will get the hang of this!
    MrB

    Thanks guys you were right it was parse problem with the var type.
    I have changed the code adding parseInt where necessary.
    I have also added the other functions. But now after it was working fine with just the one function it is doing the strangest thing.
    There are no errors, it is running fine but it is outputting the letter "a" instead of any numbers? Is this something to do with the strings? It is most odd.
    Any help would be greatly appreciated.
    Here is the new code:
    import flash.ui.Mouse;
    var Hnum:String;
    var PCnum:String;
    var PCcalc:Number;
    var Pmath:Number;
    var calc:Number = 25;
    var Total:Number;
    num1.restrict = "0-9";
    num2.restrict = "0-9";
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function PartCount(event:MouseEvent):void{
        if (parseInt(PCnum) > 0 && parseInt(PCnum)< 10){
            PCcalc == 1;
        if (parseInt(PCnum) > 11 && parseInt(PCnum)< 20){
            PCcalc == 2;
        if (parseInt(PCnum) > 21 && parseInt(PCnum)<200){
            PCcalc == 3;
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function PartCalc(event:MouseEvent):void{
        if (PCcalc == 1){
            Pmath * 10;
        if (PCcalc == 2){
            Pmath * 5;
        if (PCcalc == 3){
            Pmath * 1;
    Est_btn.addEventListener(MouseEvent.CLICK, calculate);
    function calculate(event:MouseEvent):void{
        Hnum = num1.text;
        PCnum = num2.text;
        Total = parseInt(Hnum) * calc + Pmath;
        Total.toString();
        Total_txt.text = String(Total);
    Thanks
    MrB

  • Why is there an error when activating custom wsp's (timer job) via SharePointUI?

    We have created a Timer Job Project.
    Before packaging wsp and deploying via PowerShell:- 
    1. If I set scope to Web and go to site features then I hit on Activate it gives error
    (sayin to enable debug for error msg in web.config).
    2. Similarly, if I set scope to Site, then if I go into site collection features and activate,
    it give same error.
    3. If scope is set to Web Application then the feature is activated by default (under
    web app features), but cannot see the job under job definitions.
    4. If scope is set to farm, then (under farm features) similar to above point no. 3
    There is also error when deactivating features which are already activated when a package
    is deployed. for example: web applicaiton feature. 
    Further, I cannot see the timer job under job defn unless it is scoped to SITE..
    Why is this?
    I donot get the issues when activating the features via PowerShell. Why is this?

    Hi Nachiket Kamat,
    When you are using web scoped or site scoped features to install the timer jobs, the account that does the scheduling must have write permissions to the configuration database of the server farm, usually, the identity of the application pool that is hosting
    the SharePoint site does not have permissions on the configuration database, this is the account that is used when you activate the feature through the browser interface, this may cause the feature activated failed.
    Another scenario that you met when you change the feature scope to web application, job definition cannot be seen, this may be caused by the feature receiver code, like if scope to web application, then get the web application from properties.Feature.Parent
    as SPWebApplication, if you change the feature scope, then this also need to change to get the proper object.
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Why is there an error message when I try to update to ios 5.1 on my iPod touch?

    When I click "Install Now" it says "Verifying" then an error message pops up saying that there was an error updating and it dosent give me much more information.

    This indicates an issue with the network.
    Power cycle the ATV, router, and computer.

  • Why is there an error when connecting to the Itunes store?

    When I try to connect to my Itunes, it says there is an error and to try back later? I have never had an issue with this and am unsure what to do to fix it. Also, when I try to download the newest version of Itunes it says it can't find the file with the Itunes "installationpackage.msi"? I have never had any issues connecting to my Itunes store or downloading a newer version..

    Hi gymtrainger55,
    When having iTunes Store connectivity issues, the following articles provide the best solutions:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Thanks,
    Matt M.

  • Why are there CORBA error messages -- COMM_FAILURE when using the orb obj?

    Hi Guys,
    I followed the tutorial http://download.oracle.com/javase/6/docs/technotes/guides/idl/GShome.html
    compiled and run the code. Everything works fine however whenever I use the ORB orb object I get the following message
    both in my Naming Service and the HelloServer output:
    2010-12-10 12:35:46.505 FINE Transport to 127.0.1.1:44100: stream closed on read < 0
    2010-12-10 12:35:46.506 FINE ServerGIOPConnection to 127.0.1.1:44100 (ec4a87): getMessage() -- COMM_FAILURE
    2010-12-10 12:35:46.507 FINE ServerGIOPConnection to 127.0.1.1:44100 (ec4a87): streamClosed()
    2010-12-10 12:35:46.508 FINE ServerGIOPConnection to 127.0.1.1:44100 (ec4a87): close()
    Why is this happening?
    I have also installed jacorb and added it to my class path and run the examples with:
    jaco -Djacorb.config.dir=. -DORBid=HelloClient HelloServer
    ns -Djacorb.naming.ior_filename=/home/zorg/Project/Java/CORBA/NameService/NS_Ref
    jaco -Djacorb.config.dir=. -DORBid=HelloClient HelloClient
    I have included the code from the tutorial for convinience:
    // HelloServer.java
    // Copyright and License
    import HelloApp.*;
    import org.omg.CosNaming.*;
    import org.omg.CosNaming.NamingContextPackage.*;
    import org.omg.CORBA.*;
    import org.omg.PortableServer.*;
    import org.omg.PortableServer.POA;
    import java.util.Properties;
    class HelloImpl extends HelloPOA {
      private ORB orb;
      public void setORB(ORB orb_val) {
        orb = orb_val;
      // implement sayHello() method
      public String sayHello() {
        return "\nHello world !!\n";
      // implement shutdown() method
      public void shutdown() {
        orb.shutdown(false);
    public class HelloServer {
      public static void main(String args[]) {
        try{
          // create and initialize the ORB
          ORB orb = ORB.init(args, null);
          // get reference to rootpoa & activate the POAManager
          POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
          rootpoa.the_POAManager().activate();
          // create servant and register it with the ORB
          HelloImpl helloImpl = new HelloImpl();
          helloImpl.setORB(orb);
          // get object reference from the servant
          org.omg.CORBA.Object ref = rootpoa.servant_to_reference(helloImpl);
          Hello href = HelloHelper.narrow(ref);
          // get the root naming context
          org.omg.CORBA.Object objRef =
              orb.resolve_initial_references("NameService");
          // Use NamingContextExt which is part of the Interoperable
          // Naming Service (INS) specification.
          NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
          // bind the Object Reference in Naming
          String name = "Hello";
          NameComponent path[] = ncRef.to_name( name );
          ncRef.rebind(path, href);
          System.out.println("HelloServer ready and waiting ...");
          // wait for invocations from clients
          orb.run();
          catch (Exception e) {
            System.err.println("ERROR: " + e);
            e.printStackTrace(System.out);
          System.out.println("HelloServer Exiting ...");
    // Copyright and License
    import HelloApp.*;
    import org.omg.CosNaming.*;
    import org.omg.CosNaming.NamingContextPackage.*;
    import org.omg.CORBA.*;
    public class HelloClient
      static Hello helloImpl;
      public static void main(String args[])
          try{
            // create and initialize the ORB
            ORB orb = ORB.init(args, null);
            // get the root naming context
            org.omg.CORBA.Object objRef =
                orb.resolve_initial_references("NameService");
            // Use NamingContextExt instead of NamingContext. This is
            // part of the Interoperable naming Service. 
            NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
            // resolve the Object Reference in Naming
            String name = "Hello";
            helloImpl = HelloHelper.narrow(ncRef.resolve_str(name));
            System.out.println("Obtained a handle on server object: " + helloImpl);
            System.out.println(helloImpl.sayHello());
            helloImpl.shutdown();
            } catch (Exception e) {
              System.out.println("ERROR : " + e) ;
              e.printStackTrace(System.out);
    }Edited by: 819887 on 10-Dec-2010 04:51
    Edited by: 819887 on 10-Dec-2010 04:58

    Figure out the actual problem is when the naming service is resolving the name on line:
    helloImpl = HelloHelper.narrow(ncRef.resolve_str(name));

  • Why is there an "error during muxing preparation?"

    Suddenly I keep getting error messages in my iDVD 08 version 7.0.2 (1100). It was working fine a coupledays ago and then I upgraded to Snow Leopard (from 10.5.8 to 10.6.3) and I think at same time the install gave me QuickTime 10.0 (I had had QT 7.6.9 before). Now I’ve tried four short videos to burn DVD and each time I get the message “There was an error during muxing preparation (projection conversion).”I use Final Cut Express 4.0 and exported first via Quick Time movie and then via Mpeg4 to see if that made a difference. (It didn’t.) I’ve worked a long time to do a five-minute video on my eldest son to give him as a present, andnow I can’t burn it. Any and all help greatly appreciated. (BTW, on web, I saw that one issue might be I don’t have enough disc space, but I’ve got 101 GBfree, so that can’t be it.)
    Desperate for advice...  Thanks in advance for any help.

    Hello, John.
    Looks like there are some other posts on this and it could be related to chapter markers and transitions.  Also, Quicktime is a "container" format and the underlying format (codec) could be part of the problem -- have you used that specific format and work flow previously?
    https://discussions.apple.com/message/6942255#6942255
    https://discussions.apple.com/message/9946243#9946243
    https://discussions.apple.com/message/5157904#5157904
    John

  • Why is there an error every time i sync?

    every time i try to sync my ipod touch 4g it tells me at the very end of the sync that there was an error syncing. What is it about? Can i fix it or do you guys have to do it? please answer me soon. THANX

    Does it sync correctly?  if not what does not get synced?  Waht is happening when you get the error?  Is there any other information in the error message like a number?  The exact wording of the message would be hrlpful

  • Why is there an 'Error: No Data' sign when importing in Log and Transfer?

    Hello,
    I am trying to import clips from my Panasonic HDC-SD100 camcorder into Final Cut Express 4. I am using the Log and Transfer window and am able to import most of my clips. However, every time I import there are a handful of clips that are left idle and an 'Error: No Data' sign appears next to them. They have not been imported to the Scratch Disk, and yet there doesn't seem to be anything wrong with them because they playback on the viewing screen in the Log and Transfer window. Can anyone help me to determine what is wrong?
    Many thanks.

    Some of the descriptions you are using are kind of confusing.
    "first 2 controls of each DO line(s)"
    "button 1 of DO lines 1 and DO lines 2"
    "control 2 of DO lines 1 and DO lines 2"
    What is the difference between "button 1" and "control 2".  I am going to assume you mean the same thing when you say "button" vs. "control" but just decided to change terminology in mid-sentence
    You need to write out a Truth table to describe what you need done.  The way you have the description written, you are already using the word "OR" to describe the different situations.  That is going to be a key part of your program.
    This shows:
    (DOlines button1 AND button2)  OR
    (DOlines2 button1  AND button2) OR
    (DOlines button1 AND DO lines2 button1)  OR
    (DOlines button2 AND DO lines2 button2)
    Attachments:
    002[1]_BD.png ‏11 KB

  • HT201442 so why was there an error with me trying to restore my ipod i dont get it please someone explain?!

    So there was an error when i tried to restore my ipod i don't get it.. someone please help me!?

    If not this error:
    iOS: Restore error 3194 or 'This device isn't eligible for the requested build'
    What was the error?

Maybe you are looking for

  • Can I create a fillable form in Pages and then PDF to iWeb?

    I'm a teacher and I'd like to be able to upload some PDF documents for my students to download, but would LOVE it if I could make sections of the document available for them to fill out answers, so they could, in turn, save as PDF and send back to me

  • Preview not showing some text in certain PDFs

    I've had issues with a couple of PDFs this year that did not display correctly in Preview, but are viewable in Acrobat Reader. An example is here on pages 31-36. Preview shows blank gridlines, but Acrobat Reader shows text and numeric data in those c

  • How to refresh regions of same fragment used twice as region

    Hello, I have a fragment A which uses fragment B as a region twice. The state of the fragment B is kept on a viewScope bean. So each instance of the fragment B region has its own instance of the viewScope bean. I have a button in fragment B which doe

  • Weblogic portal Integration with UCM by weblogic virtual repository

    Anyone has experience with Weblogic portal Integration with UCM by weblogic virtual repository? Thanks.

  • Error Message for now defunked server

    I previously had a NAS drive set up to my server. I have since discarded it. The problem is when as soon as i load up an iLife product or even Aperture i get this message "The server "wd-netcenter" may not exist or it is unavailable at this time. Che