How many number of lines of code Java File can have?

Hi ALL
Is there any limit on java source file code length?
does more code (say more than 4000 line) impact on performace?
Is there any recomendation on code length and file size?
Thanks

Hi ALL
Is there any limit on java source file code length? There are some (VM) limitations but I have only hit that one when I had some generated code.
does more code (say more than 4000 line) impact on
performace?No, but you probably have a stupid design if you have 4000 lines in one file.
Is there any recomendation on code length and file
size?You should usually only have one top level clas per file, and you should try to have less than 1000 lines in one class.
Kaj

Similar Messages

  • How can I find out the number of lines in a text file?

    How can I find out the number of lines in a text file?

    java.io.BufferedReader in = new java.io.BufferedReader( new java.io.FileReader( "YourFile.txt" ) );
    int lineCount = 0;
    while( in.readLine() != null )
    lineCount ++;
    System.out.println( "Line Count = " + lineCount );

  • How to find number of lines in an input file.

    Hi,
    Can someone tell me, if there is a way to find out the number of lines in an input file. I do not want to read line by line and then count the number of lines read.

    Then how do you think a program could determine the amount of lines in an input file? How does a human know how many lines are on a page? You're going to have to count the items that separate two lines to know how many lines are in your file.
    Either read line by line and count the amount or read char by char and count the number of '\n' occurences instead.
    If you have control over writing the input files, however, you can make this better. Write a header in the file that specifies the amount of lines in it. The first line of your file will then hold a number that represents the amount of lines in the file, so you need only read the first line to know how many lines are in your file.

  • Total number of lines of code in a class.

    Dear Experts,
    Given a class, I want to find out the total number of lines of code in all of its methods.  Following sub-parts are derived.
    1.  Find out all the methods of the class
    2.  Find out the number of lines for each of these methods and finally add the total number.
    Can you kindly let me know how I can do this?  Thanks a lot !
    Best Regards, Vikram

    Be aware that a 2D array is an array of arrays, which don't necessarily have to be the same length. e.g.int[][] a = new int[2][];
    a[0] = new int[10];
    a[1] = new int[20];
    /* a.length == 2
       a[0].length == 10
       a[1].length == 20*/

  • Apple recently made me change my password which was fine but now it keeps telling me the security code on my visa is incorrect now matter how many times i  re-enter it.  I can no longer download or update my phone.  Please help!!!!

    Apple recently made me change my password which was fine but now it keeps telling me the security code on my visa is incorrect now matter how many times i  re-enter it.  I can no longer download or update my phone.  Please help!!!!

    Did you go on-line and fix your billing information? You probably need to do this from iTunes on your computer, not your phone.
    If you've double checked your credit card info and it still won't take it, contact your card issuer.

  • How many number of times a particular report was executed

    Hi..My requirement is to find how many number of times a report/tcode was executed in a particular period of time.I tried using STAD,STAT AND ST03 ..but i am not able to find how many number of times the particular report was executed ..is there any other tcode or table or FM ..that would solve this problem..its bti urgent..wud reward points for all useful answers could u let me know under what name or field int eh out put this particular info that i am looking for wud be displayed?

    Hi,
    The following code i found from this forum, may this will help you.
    * internal tables for use counter
    data: begin of list occurs 5.
            include structure sapwlserv.
    data: end of list.
    data: begin of applicat occurs 0.
            include structure sapwlustcx.
    data: end of applicat.
    data: begin of applica_ occurs 0.
            include structure sapwlustcx.
    data: end of applica_.
    data: begin of applicau occurs 0,
            entry_id like sapwlustcx-entry_id,
            account  like sapwlustcx-account,
            count    like sapwlustcx-count,
        : end of applicau.
    data: wa_applicau like applicau.
    *&      Form  MONI
    form moni.
      data: l_host like  sapwlserv-hostshort.
      m_start = p_usedt.
    *** get server
      call function 'SAPWL_SERVLIST_GET_LIST'
           tables
                list = list.
      do.
        loop at list.
    *** loop on server
          check not list-instshort is initial.
          l_host = list-instshort.
    *** get statistics per month and server
          perform workload using m_start l_host.
        endloop.
        add 31 to m_start.
        if m_start > sy-datum.
          exit.
        endif.
      enddo.
      sort applica_ by entry_id.
      sort applicau by entry_id count descending.
    endform.                               " MONI
    *&      Form  WORKLOAD
    form workload using    p_start like sy-datum
                             p_host  like  sapwlserv-hostshort.
      refresh: applica_.
    *** read application statistic from MONI
      call function 'SAPWL_WORKLOAD_GET_STATISTIC'
           exporting
                periodtype                 = 'M'
                hostid                     = p_host
                startdate                  = p_start
                only_application_statistic = 'X'
           tables
                application_statistic      = applica_
           exceptions
                unknown_periodtype         = 1
                no_data_found              = 2
                others                     = 3.
      sort applica_ by entry_id account.
      loop at applica_  where entry_id(1) ge 'Y'.             "#EC PORTABLE
        clear wa_applicau-entry_id.
        wa_applicau-entry_id(25) = applica_-entry_id.
        wa_applicau-account      = applica_-account.
        wa_applicau-count        = applica_-count.
        collect wa_applicau into applicau.
      endloop.
      sort applicau by entry_id count descending.
      applica_-ttype    = space.
      applica_-account  = space.
      modify applica_ transporting ttype account
             where ttype ne space.
    *** collect only enhancements statistic
      if p_temp = 'X'.
        loop at applica_.
          applica_-entry_id+25(48) = space.
          collect applica_ into applicat.
        endloop.
      else.
        loop at applica_ where entry_id(1) ge 'Y'.            "#EC PORTABLE
          applica_-entry_id+25(48) = space.
          collect applica_ into applicat.
        endloop.
      endif.
    endform.                               " WORKLOAD
    aRs
    Points are always welcome

  • How to Know the How many number of JCo connections established?

    Hi
    How to Know the How many number of JCo connections established for mapping?

    Hi
    mConnection =  JCO.createClient("001", // SAP client
                  "<userid>", // userid
                  "****", // password
                  null, // language
                  "<hostname>", // application server host name
                  "00"); // system number
    //Connections to a specific application server (as in the above example)
    mConnection.connect();
    //Creating the JCO.Client object does not connect to SAP, but a subsequent call to
    connect() will accomplishes this
    So you can easily find out the number of JCo connections by checking out these.
    Thanks

  • How many licenses my comapny has and how many number of users logged in.

    Hi All,
    Can any one tell,
    before login into the SAP B1,
    I want to know
    how many licenses my comapny has and how many number of users(Licenced) logged in using Query Analyzer or any other way.
    Thanks
    Chakrapani
    Edited by: chakrapani bandaru on Feb 17, 2010 12:58 PM

    Hi Sunderraj,
    Can u eloberate the answer,
    I want to take a report of that count.
    Thanks
    Edited by: chakrapani bandaru on Feb 17, 2010 2:14 PM

  • HT5858 My iPad is disabled and wants a 4 digit number as a pass code.  All I have is my Apple ID and password.  I do not know how to get to my number or reset it

    My iPad is disabled and wants a 4 digit number as a pass code.  All I have is an Apple ID and password.  How can I get this fixed?

    Karen ..
    Try here   >  iOS: Forgotten passcode or device disabled after entering wrong passcode

  • How Many  NUMBER Fields Can SINGLE DATA BASE TABLE CONTAIN

    How Many  NUMBER Fields Can SINGLE DATA BASE TABLE CONTAIN

    Hi
    One Database table contain 249 Fields.
    Rewards Points if useful..
    Regards
    Nikunj Shah
    Edited by: Nikunj Shah on May 13, 2008 1:08 PM

  • HT4059 Being new to iBook publishing I need to know if stats are available to determine how many times my iBook has been downloaded. Can anyone help please? Mr Ignorant

    Being new to iBook publishing I need to know if stats are available to determine how many times my iBook has been downloaded. Can anyone help please? I need to persuade someone that this really is worthwhile. Mr Ignorant.

    The only people who can possibly assist you with this is Apple Customer Relations, call your local Apple contact number and ask for Customer Relations then explain your situation clearly and politely (be firm but don't rant).
    You might want to investiage what the local laws are regarding defective goods and 'fit for use' definitions on warranties etc. Consumer Protection can be a useful tool to use or bargain with if needed ...

  • Flex 3 How to recording the voice to the local file.can u help sample souce code

    How to recording the voice to the local file.can u help sample souce code

    What? the link is not opening? Check once properly man.  If you need code here it is
    import flash.system.Security;
    import flash.media.Microphone;
    import flash.events.ActivityEvent;
    import flash.events.SampleDataEvent;
    import flash.events.StatusEvent;
    import flash.utils.ByteArray;
    import flash.media.Sound;
    import flash.events.MouseEvent;
    import flash.media.SoundChannel;
    import flash.events.Event;
    import org.bytearray.micrecorder.encoder.WaveEncoder;
    import flash.net.FileReference;
    var mic:Microphone;
    var soundBytes:ByteArray;
    var recBytes:ByteArray= new ByteArray();
    var sc:SoundChannel;
    var sound:Sound;
    recordBtn.addEventListener(MouseEvent.CLICK, getMic);
    stopBtn.addEventListener(MouseEvent.CLICK, stopRecording);
    playBtn.addEventListener(MouseEvent.CLICK, plays);
    saveBtn.addEventListener(MouseEvent.CLICK, saveAudio);
    function getMic(e:MouseEvent)
    soundBytes= new ByteArray();
    //returns an array that total mics available
    var totalMics:Array = Microphone.names;
    //mic is a singleton class gets microphone to record sound
    mic = Microphone.getMicrophone();
    //Sets the minimum input level that should be considered
    mic.setSilenceLevel(0);
    mic.rate = 44;
    //to capture microphone audio listen for this event
    mic.addEventListener(SampleDataEvent.SAMPLE_DATA, recordAudio);
    function recordAudio(e:SampleDataEvent)
    //capture the byte array data available with the event
    while (e.data.bytesAvailable)
    var soundData:Number = e.data.readFloat();
    soundBytes.writeFloat(soundData);
    function stopRecording(e:MouseEvent)
    mic.removeEventListener(SampleDataEvent.SAMPLE_DATA, recordAudio);
    //set the bytearray position to zero for playing from starting
    soundBytes.position = 0;
    function plays(e:MouseEvent)
    //intatiazle sound instance
    sound= new Sound();
    soundBytes.position = 0;
    //listen for the event when runtime requests new audio data.
    sound.addEventListener(SampleDataEvent.SAMPLE_DATA, playAudio);
    //play the sound with sound channel
    sc = sound.play();
    sc.addEventListener(Event.SOUND_COMPLETE, soundComplete);
    function playAudio(e:SampleDataEvent)
    //if audio bytes is greate than 4 read the recorded byte array data and write it into the sound
    for (var i=0; i<8192; i++)
    if (soundBytes.bytesAvailable > 4)
    var sample:Number = soundBytes.readFloat();
    e.data.writeFloat(sample);
    e.data.writeFloat(sample);
    function soundComplete(e:Event)
    sound.removeEventListener(SampleDataEvent.SAMPLE_DATA, playAudio);
    sc.stop();
    function saveAudio(e:MouseEvent)
    soundBytes.position = 0;
    //waveencoder class used to encodes bytearray data properly used to play properly after saving
    //you can get this api from below link
    //http://code.google.com/p/micrecorder/downloads/detail?name=MicRecorder%201.2.zip&can=2&q=
    var encod:WaveEncoder= new WaveEncoder();
    var byte:ByteArray = encod.encode(soundBytes,2);
    var file:FileReference= new FileReference();
    file.save(byte, “test.wav”);

  • Count the number of lines in a txt file

    I need to count the number of lines in a txt file, but I can't do it using readLine(). This is because the txt file is double spaced. readLine() returns null even if it is not the end of the file. thanks for the help

    I need to count the number of lines in a txt file,
    but I can't do it using readLine(). Then just compare each single byte or char to the newline (code 10).
    This is because the txt file is double spaced. readLine() returns
    null even if it is not the end of the file.Errm what? What do you mean by "double spaced"? Method readLine() should only return null if there's nothing more to read.

  • No matter how many times I start itunes on my pc I have to agree to the terms of service gain and when it does open my settings have all been changed.  why is it doing this and how can I satop it?  reinstalling does not fix it.

    No matter how many times I start itunes on my pc I have to agree to the terms of service again and when it does open my settings have all been changed.  Why is it doing this and how can I stop it?  Reinstalling/repairing does not fix it.

    McAfee AntiVirus by any chance? See the thread Why does iTunes delete my itunesprefs.xml?
    Or it could be an issue with the SC Info folder. See TS1277 - iTunes: Missing folder or incorrect permissions may prevent authorization for details.
    Or a repair install of iTunes from the Programs and Features control panel might fix the problem.
    tt2

  • How many WHEREs do we need in minimun when we have 4 FROMs in the statement

    How many WHEREs do we need in minimun when we have 4 FROMs <tables> in the statement?

    Technically none - but it produces cartesian join:
    SQL> SELECT * FROM scott.emp, scott.dept, scott.salgrade;
         EMPNO ENAME      JOB               MGR HIREDATE        SAL       COMM
        DEPTNO     DEPTNO DNAME          LOC                GRADE      LOSAL
         HISAL
          7788 SCOTT      ANALYST          7566 87/04/19       3000
            20         40 OPERATIONS     BOSTON                 3       1401
          2000
          7839 KING       PRESIDENT             81/11/17       5000
            10         40 OPERATIONS     BOSTON                 3       1401
          2000
         EMPNO ENAME      JOB               MGR HIREDATE        SAL       COMM
        DEPTNO     DEPTNO DNAME          LOC                GRADE      LOSAL
         HISAL
    280 wierszy zosta│o wybranych.

Maybe you are looking for

  • Error message in ME21N and ME22N

    Dear Friends, I am facing one problem... my requirement is at the time of saving purchase order i need to check some thing and if that check fails i need to display the error message and needs to stop the creation of purchase order. That error messag

  • Can no longer automatically load pics from camera to iPhoto

    I am running iPhoto 5.0.4 and I have a Panasonic Lumix DMC-FZ20. Until recently I merely had to plug my camera into the computer using the USB connection to load pics. Now when I do it, iPhoto does not launch and better still, the keyboard and mouse

  • How to install ABAP as a backend system in my EHP1

    I have successfully installed EHP1 composition enviornment from SDN , now i m able to work on NWDS for JAVA and Enterprise portal . it contains java application server . but in order to get data from ABAP Backend system from NWDS(JAVA) , I don't have

  • Recomendations for Hard Drive recovery tool

    Does any one have a recommendation for a Hard Drive recovery tool? My brothers external Lacie 200MB Firewire drive has crapped out. He has all his family movies (iMovie projects) stored on it so he really needs to recover the files if possible. I hav

  • Username not displayed when afp login

    Greetings I have a osx yosemite server hosting /Volume/HD/Groups & /Volume/HD/Users when a user logs in, traditionally they would see their personal folder as an option. after credentials have passed the user is only presented with 2 options; Users G