ElaKiri Programmer's Club

MihiCherub

Well-known member
  • Sep 14, 2009
    18,861
    1
    9,624
    113
    Gampaha
    එළකිරි කොල්ලෙක්;16696780 said:
    cin.get() ;
    ekak danne mkada machan??

    kelinma getVolume() call karama enne nedda??
    it just keeps the console window open so the user can see the output of the program.

    it does so by getting the next character in the console, the command prompt will close as soon as the program finishes, meaning you can't see the output. Putting cin.get() forces the program to wait for the user to enter a key before it can close, and you can see the output of your program.
     

    MihiCherub

    Well-known member
  • Sep 14, 2009
    18,861
    1
    9,624
    113
    Gampaha
    JAVA

    මචන්ල jfreechart එකක y axis range එක වෙනස් කරන්න දන්න කෙනෙක් ඉන්නව නම් දාන්නකො.. මම අදින්නෙ line Chart එකක්.. ඒකෙ y අගයන් තියෙන්නෙ 60 ඉදන් 80 ට වගේ ඒත් Chart එක y ඇදෙන්නෙ 0 ඉදන් 5න් 5ට එතකොට ඇදෙන ලයින් එක පැහැදිලි නෑ මට ඕනෙ y axis එක 60 න් පටන් අරන් 2න් 2ට ඇදගන්න. :(
    Language - JAVA
     
  • Jul 6, 2012
    10,677
    2,901
    113
    it just keeps the console window open so the user can see the output of the program.

    it does so by getting the next character in the console, the command prompt will close as soon as the program finishes, meaning you can't see the output. Putting cin.get() forces the program to wait for the user to enter a key before it can close, and you can see the output of your program.
    Thnx machan! :D i never knw abt that :)
     

    leap_coder

    Member
    Mar 29, 2014
    428
    17
    0
    machan kawuruwath dannawada yamu.lk,tasty.lk wage web systems karala thiyena platforms?php frameworks da naththan joomla,wordpress wage cms da kiyala?
     

    markhaloce

    Member
    Mar 7, 2013
    10,298
    677
    0
    17
    The Real North
    C++

    ඔය ටෙම්ප්ලේට් ක්ලාස් වලට එහෙම බැහැගෙනම නානවද බං ?
    මං කිව්වෙ template <class a, class b, class c, class d, double e> කිය කිය ඔහොම පැරාමීටර්ස් දහය පහලොව තියෙන එව්ව එහෙම බහුලව භාවිතා වෙනවද බං ? නැත්තං ඕවර්ලෝඩිං කරන්න කම්මැලි කමට කෝකටත් තෛලෙ කියල එක පැරාමීටර් එකක් ගහල ශේප් වෙනවද ?

    :D C++ අත්දැකීම් තියෙන උන් පොඩ්ඩක් කියාංකො..
     

    sw7x

    Well-known member
  • Nov 12, 2007
    11,114
    2,296
    113
    ai machan eheme kiwwe?javascript echchcarama amaru nahane.habai nikanma javascript karala hariyana ekak naha.NodeJS wage ekak karanna wei.thawa AngularJS ehema :D

    language eka echchra maruwak ane but browser DOM ekathekka waeda karana eka thamai amaru
    aeyi heta huta hamarak dom objects wala methods properties thogyak thiyanawane
     

    හෙළයෙක්

    Well-known member
  • Apr 26, 2014
    48,553
    98,516
    113
    machan oya sites okkoma wordpress da?sure da ban?mama source code eka baluwa.tasty eke machan wp tag ekak hambune nahane:rolleyes:
    YAMU nan sure wordpress. meka mehema thiyenawa kiyane anik ewath default names dala athe ane manda hena risk wedak eka nan. anyway sure word
    http://www.yamu.lk/wp-login.php?redirect_to=http://www.yamu.lk/wp-admin/&reauth=1

    tasy nan machan wordpress newi kiyanama be but oya wage hadana puluwan ban 1month athulatha framwork nathuwa unath.codeignetor eka use karala wenath puluwan. eka gena nan no idea.
     

    DooA

    Well-known member
  • Jun 22, 2011
    5,202
    773
    113
    ආගිය අතක් නැත

    ජාවා වල විතරක් නෙමෙයි ගොඩක් languages වල method වලට parameters pass කරද්දී variable වලට reference එක පාස් කරනේ නැනේ .
    Value එක විතරයි නේ පාස් කරන්නේ. එත් මචං මට පොඩි අවුලක් තියෙනවා. පල්ලෙහා තියෙන එක බලපන්. එකේ main method එකේදී Object කියල class එකේ instance එකක් හදලා DoThings කියල class එකට යවනවා. එතකොට යන්න ඕනේ actual instance වෙනුවට තියෙන instance එකේ copy එකක් නේ. එතකොට වෙන්න ඕනේ DoThing class එකේදී යවන instance එකේ variable එක වෙනස් (100) කරලා print කරනවා. එතකොට වෙනස් කරපු value එක ප්‍රින්ට් වෙනවා එක හරි. එත් දැන් main එකේදී තියෙන instance එකේ value එක display කරාම print වෙන්න ඕනේ 10 යි කියලා. මොකද default value එක 10 තියෙන්නේ. අනික method එකට pass කරන්නේ actual object එක නෙමෙයි. එක නිසා method එකේදී මොනවා කරත් main එකේ තියෙන object එකට අදාලා නෑනේ.

    එත වෙන්නේ අනික් පැත්ත main එකේ තියෙන object එකත් වෙනස් වෙනවා.

    එත මේක primitive data type වල නම් main එකේ තියෙන variable එක වෙනස් වෙන්නේ නෑ. ඒ කියන්නේ primitive data type වලදී යවන්නේ actual variable එක නෙමෙයි. නමුත් instance වලදී යවන්නේ actual එකද.

    මේක හෙන අවුල් බන්.


    Code:
    public class Main {
    
        public static void main(String[] args) {
            Object obj = new Object();
    
            new DoThing(obj); // send instance to dothing class
    
            obj.display(); // print current value . this must be 10
    
        }
    
    }


    Code:
    class DoThing {
    
        public DoThing(Object object) {
            
            object.setVALUE(100);    // set value to 100
            
            object.display(); // print it
        }
    }

    Code:
    class Object {
    
        private int VALUE = 10;
    
        public void display() {
            System.out.println(VALUE);
        }
    
        public void setVALUE(int a) {
            VALUE = a;
        }
    
        public int getVALUE() {
            return VALUE;
        }
    
    }
     

    DJvodka

    Well-known member
  • Mar 31, 2009
    3,375
    292
    83
    A land like no other

    ජාවා වල විතරක් නෙමෙයි ගොඩක් languages වල method වලට parameters pass කරද්දී variable වලට reference එක පාස් කරනේ නැනේ .
    Value එක විතරයි නේ පාස් කරන්නේ. එත් මචං මට පොඩි අවුලක් තියෙනවා. පල්ලෙහා තියෙන එක බලපන්. එකේ main method එකේදී Object කියල class එකේ instance එකක් හදලා DoThings කියල class එකට යවනවා. එතකොට යන්න ඕනේ actual instance වෙනුවට තියෙන instance එකේ copy එකක් නේ. එතකොට වෙන්න ඕනේ DoThing class එකේදී යවන instance එකේ variable එක වෙනස් (100) කරලා print කරනවා. එතකොට වෙනස් කරපු value එක ප්‍රින්ට් වෙනවා එක හරි. එත් දැන් main එකේදී තියෙන instance එකේ value එක display කරාම print වෙන්න ඕනේ 10 යි කියලා. මොකද default value එක 10 තියෙන්නේ. අනික method එකට pass කරන්නේ actual object එක නෙමෙයි. එක නිසා method එකේදී මොනවා කරත් main එකේ තියෙන object එකට අදාලා නෑනේ.

    එත වෙන්නේ අනික් පැත්ත main එකේ තියෙන object එකත් වෙනස් වෙනවා.

    එත මේක primitive data type වල නම් main එකේ තියෙන variable එක වෙනස් වෙන්නේ නෑ. ඒ කියන්නේ primitive data type වලදී යවන්නේ actual variable එක නෙමෙයි. නමුත් instance වලදී යවන්නේ actual එකද.

    මේක හෙන අවුල් බන්.


    Code:
    public class Main {
    
        public static void main(String[] args) {
            Object obj = new Object();
    
            new DoThing(obj); // send instance to dothing class
    
            obj.display(); // print current value . this must be 10
    
        }
    
    }


    Code:
    class DoThing {
    
        public DoThing(Object object) {
            
            object.setVALUE(100);    // set value to 100
            
            object.display(); // print it
        }
    }

    Code:
    class Object {
    
        private int VALUE = 10;
    
        public void display() {
            System.out.println(VALUE);
        }
    
        public void setVALUE(int a) {
            VALUE = a;
        }
    
        public int getVALUE() {
            return VALUE;
        }
    
    }

    All objects => pass by reference

    All primitives => pass by value