~~~~~~~~~~~~Java Mega Tread~~~~~~~~~~~~~

KingCM

Well-known member
  • Jul 23, 2013
    6,920
    948
    113
    www.biogen.lk
    ගොඩක් අය java පටන් අරන් desktop app ගහනවා. web ගහන අය php කරනවා. java වලින් desktop app ගහන අය දැන ගන්නව් C# ගැන. ඊට පස්සේ java ජරාව කියලා c# කරනවා. නමුත් මට හිතෙන විදියට java වැල 10% වගේ තමයි desktop පැත්තට තියෙන්නේ (එච්චරත් නැද්ද මන්ද) අනික් ඒවා ඔක්කොම java web පැත්තේ. spring/hibernate වගේ කරපු කෙනෙක් දන්නවා ඇති php වගේ ඒවගේ නැති ගොඩක් ඒවා java වල තියෙනවා කියලා/


    echchararth na wage ban......

    java web enterprise side eke loku........... 90% kma java web side eka ...
     
    • Like
    Reactions: kavindu84
    [URL="http://www.elakiri.com/forum/showthread.php?t=1691878"][URL="http://www.elakiri.com/forum/showthread.php?t=1692188"][URL="http://www.elakiri.com/forum/showthread.php?t=1692578"][URL="http://www.elakiri.com/forum/showthread.php?t=1693374"]http://www.elakiri.com/forum/showthread.php?t=1691762[/URL][/URL][/URL][/URL]

    මේ තියෙන්නෙ J Sparrow දාපු java web development පාඩම් මාලාවක්.සරලව පැහැදිලිව කියල දීල තියෙනවා.ගිහින් බලන්න.
     

    owlX

    Well-known member
  • Jul 13, 2014
    1,321
    400
    83
    /usr/bin
    Machanla C++ balapan bn. Cross platform ynwanm Qt eka standard java library use karala.
    Windows nam visual c++ aulak na. :D java ee kohomda nam dne na. Godak company use krne hoda hinda wena athine. But c++ igna gna eka hama pathenma hodai kiyla hithenwa. Mage adahasak withrai. Anyway keep going machan :)
     
    අද Variables ගැන බලමු.:):)පාඩමක් දාන්න ටිකක් පරක්කු උනාට සමාවෙන්න යාළුවනේ.මේ දවස් වල ටිකක් වැඩ තිබුණා.තාම ජාවා වල මුල්ම ටික නිසා දන්න අයට නම් මේක බෝරින්ග් වෙයි.හරි එහෙනම් පාඩම මෙතැන් සිට.:nerd::nerd::nerd::nerd:

    Variables ගැන කතා කරන්න කලින් ජාවා වල තියෙන Data Types ගැන බලමු.ජාවා වල Data Types ප්‍රධාන කොටස් 2කට බෙදෙනව ඒ Primitive data types සහ Reference data types කියලා.අපි මෙතනදි කතා කරන්නෙ Primitive data types ගැන.Primitive data types 8ක් තියෙනවා.ඒ 8 ආපහු Integers, Floating Points, Charactors සහ Boolean කියල කොටස් 4කට බෙදන්න පුළුවන්. :dull::dull::eek::eek::eek::baffled:

    byte - 8bit (byte 1ක් වෙනුවෙන් ram එක තුළ bit8ක් වෙන් වේ.)
    short - 16bit
    int - 32bit
    long - 64bit
    (මේ 4 අයත් වෙන්නෙ Integers වලට.Integers වල Default data type එක int)

    float - 32bit
    double - 64bit
    (මේ 2ක අයිති වෙන්නෙ Floating Points වලට Default data type එක double)

    char - 16bit
    (මේක අයිති වෙන්නෙ Charactors වලට.)

    boolean - 1bit
    (මේක Boolean වලට)

    ඒ වගේම තවත් විදියකට char සහ boolean වලට non-numeric කියලත් අනිත් ඒවට numeric කියලත් කියන්න පුළුවන්.:):):)

    තව විස්තර මෙතනින් බලන්න.

    Variables​

    Variable එහෙම නැත්නම් විචල්‍යක් කියල කියන්නෙ වෙනස් වන සුළු දෙයකට...

    Variable එකක් හදුන්වා දීම. (Variable Declaration)
    data type variableName;
    ex -: int x;

    හදුන්වා දුන් Variable එකට value එකක් assign කිරීම. (Initialization)
    data type variableName = value;
    ex -: int x = 10;

    මෙතෙන්දි අපි 10 කියන නියතය x කියල හදුන්වන විචල්‍යකට ආදේශ කරනව.මතක තියා ගන්න මේක ආදේශ කිරීමක් විතරයි.නැතුව සමාන කිරීමක් නෙමෙයි.:sorry:ඒ කියන්නෙ x කියන විචල්‍යට ඊට පස්සෙ වෙන අගයක් උනත් ආදේශ කරන්න පුළුවන්.:dull::dull:ජාවා වලදි = ලකුණ යොදා ගන්නෙ ආදේශ කරන්න.(assign) සමානද කියල බලනව නම් == මෙහෙම සමාන ලකුණු 2ක් දාන්න ඕන.:oo::oo::oo:

    හැබැයි මෙහෙම දේකුත් තියෙනව.අපිට int x = 10; කියන Variable එක නියතයක් (Constant එකක්) කර ගන්න ඕන නම් final කියන keyword එක පාවිච්චි කරන්න පුළුවන් මේ වගේ.
    final int X = 10; (සාමන්යෙන් Constant එකකට නමක් දෙන්නෙ කැපිටල් වලින්.):frown:

    සාමන්යෙන් ඕනම පූර්ණ සන්ඛයාවක් ජාවා වලින් හදුන ගන්නෙ int එකක් විදියට.ඒ Integers වල Default data type එක int නිසා.:):)

    Variables ඉවර නෑ ඉතුරු ටික ඉක්මණට දාන්නම්.:eek::eek::eek::eek:
     
    • Like
    Reactions: Chathuranga1
    :cool::cool:අද බලමු ඉතිරි ටික.:nerd::nerd::nerd:

    float සහ double data types වල values තියා ගන්න පුළුවන් පහත ආකාරයට.

    float f = 3.14;(මෙහෙම තියන්න බෑ මේක වැරදියි :dull:)

    double d = 3.14;
    float f = (float)3.14;
    float f = 3.14f;
    float f = 3.14F;
    double d = 3.14d;
    double d = 3.14D;
    (මේ හැම විදියටම පුළුවන්:))

    char වලට තියා ගන්න පුළුවන් Character එකක් විතරයි.:eek::eek::eek:
    උදා -: char c = 'A';

    නෑ නෑ තව දේවල් පුළුවන්. :oo:

    char c = 'a';
    char c = 0 - 65535; (0 ඉදන් 65535 වෙනකන් අංක පුළුවන්)
    char c = '\b', '\n', '\t'; (escape characters)
    char c = ‘\u0000’-’\uffff’; (unicodes)
    char c = 0x0000-0xffff; (hexadecimal)
    char c = (char)-98; (- සංඛ්‍යා cast කර ලබා දිය යුතුය)

    char variable දෙකක් එකතු කළ විට assign කර ඇති character එකේ ascii value එක එකතු කිරීම හෝ අඩු කිරීම සිදු වේ.

    උදා -:
    class A{
    public static void main(String args[]){
    char a = 'a';
    char b = 'b';
    System.out.println(b-a);
    }
    }

    මෙහිදී output එක 1 ලෙස ලැබේ.a හි ascii value එක 97 වන අතර b හි 98 වේ.එනම්
    b-a = 1 ලෙස output එක ලැබේ.

    boolean වලට simple අකුරු වලින් true හෝ false පමණක් assign කළ හැක.

    boolean b = true;
    boolean b = false;
    (මෙහෙම ok :))

    boolean b = 0;
    boolean b = 1;
    (මෙහෙම බෑ :no:)

    Variables ප්‍රධාන වශයෙන් කොටස් 2කට බෙදන්න පුළුවන්.
    1. Global Variables
    2. Local Variables

    Global Variables තවත් කොටස් 2කට බෙදෙනවා.
    1. Static Variables
    2. Instance Variables

    Local Variables කොටස් දෙකකට බෙදෙනවා.
    1. Method Local Variables
    2. Block Variables

    Static Variable
    Static Variable එකක් යනු static keyword එක දාපු Global Variable එකකි.

    class A{
    static int i;
    static int j = 10;

    public static void main(String args[]){
    }
    }

    ලක්ෂණ -:

    o variable එකේ නමින්ම call කල හැක.
    class A{
    static int i = 10;
    public static void main(String args[]){
    System.out.println(A.i);
    }
    }

    output - 10

    o classes කිහිපයක් භාවිතා කරන විට class එකේ නමින්ම call කල හැක.එනම් වෙන class එකක ඇති static variables වලට තවත් class එකක සිට එම class එකේ නමින් call කල හැක.

    class A{
    static int i = 10;
    public static void main(String args[]){
    System.out.println(i);
    System.out.println(B.x);
    }
    }

    class B{
    static int x = 20;
    }

    output - 10
    20

    o Static variables සෑදිය හැක්කේ class scope එකක් තුළ පමණි.method එකක් තුළ Static variables සෑදිය නොහැක.

    ඉතිරි ටික ඉක්මණටම දාන්නම්.නැත්නම් නිදිමතේ මොනව කියයිද දන්නෙ නෑ.:dull::dull::dull:
    වැරදි අඩුපාඩු එහෙම තියෙනව නම් කියන්න හොදේ.....
    අනේ මට මේකට පින්තූර දාන්නෙ කොහොමද කියල දන්න කෙනෙක් කියල දෙන්නකෝ.දාන්න හදපු හැම එකම දාන්න බෑලුනෙ.:no::no::no:
    එහෙනම් හැමෝටම බුදුසරණයි!
    :cool::cool::cool::cool::cool: