#6 Data types in Java

Sdílet
Vložit
  • čas přidán 15. 01. 2023
  • Check out our courses:
    Enterprise Java Spring Microservices: go.telusko.com/enterpriseJava
    Coupon: TELUSKO10 (10% Discount)
    Master Java Spring Development : go.telusko.com/masterjava
    Coupon: TELUSKO20 (20% Discount)
    For More Queries WhatsApp or Call on : +919008963671
    Udemy Courses:
    Spring: go.telusko.com/udemyteluskosp...
    Java:- go.telusko.com/udemyteluskojava
    Java Spring:- go.telusko.com/Udemyjavaspring
    Java For Programmers:- go.telusko.com/javaProgrammers
    Python : go.telusko.com/udemyteluskopy...
    Git : go.telusko.com/udemyteluskogit
    Docker : go.telusko.com/udemyteluskodo...
    For More Queries WhatsApp or Call on : +919008963671
    website : courses.telusko.com/
    In this lecture we are discussing
    1) datatypes for given variable
    a)Types of data-types?
    b)primitive data types
    c)why do we need different type of integer type?
    d)how to create variable of different data types?
    2) range and way to declare different data variable
    #1
    a) Datatypes are categories into primitive and non-primitive datatype.
    But in this lecture, we are take all concept upon primitive data type.
    b) There are 8 primitive datatype
    integer ---byte, short, int, long
    float --- float , double
    character ---char
    boolean --- boolean
    c) why do we need different type of integer ?
    = there are range for each type. for int --4 bytes ,long --8 bytes, short --2bytes byte --1byte
    d) How to create variable of different data type?
    = int a=10; byte b=4
    = dataType variableName = value;
    integer variable declaration
    int a=5;
    long b=600l; // e.g 578l, 100000l represent long integer type
    byte c=127;
    short s=128;
    float vs double
    =double have more precision than float by default java support double.
    =declare variable of float and double type
    --double a=5.6;
    --but float b=5.6; //give error
    --correct way float b=5.6f;
    character representation
    = char ch='a'; //using single quotes on character we can declare char type of variable
    boolean representation of variable
    = boolean result=true; there are only two value of boolean either true or false.
    =In other language like c and c++ -- 0 is treated as false and non zero number treated as true but it is not in java.
    {byte, short, int, long, float, double, char, Boolean }
    since java is statically type or say strongly type language therefore we need
    to mention datatype for each variable for declaring variable.
    e.g int i=5; float f=2.5f;
    In java integer are by default for integer int type;
    for real number by default double
    #2
    Range and way to declare different data type variable
    int i=5;// 4 bytes ---32 bytes -- -2147483648 to 2147483647
    short s=5;//2 bytes -- 16 bytes -- -32768 to 32767
    byte b=5;//1 byte -- 8 bytes -- -128 to 127
    long l=5;//8 bytes -- 64 bytes -- -9223372036854775808 to 9223372036854775807
    float f=5.5f;//4 bytes -- 32 bytes -- 1.4e-45 to 3.4028235e+38
    double d=5.5;//8 bytes -- 64 bytes -- 4.9e-324 to 1.7976931348623157e+308
    char c='a';//2 bytes -- 16 bytes -- 0 to 65535
    boolean check=true; //value is either true or false
    ASCII - American Standard Code for Information Interchange
    Github repo : github.com/navinreddy20/Javac...
    Java:- bit.ly/JavaUdemyTelusko
    Spring:- bit.ly/SpringUdemyTelusko
    More Learning :
    Java :- bit.ly/3x6rr0N
    Python :- bit.ly/3GRc7JX
    Django :- bit.ly/3MmoJK6
    JavaScript :- bit.ly/3tiAlHo
    Node JS :- bit.ly/3GT4liq
    Rest Api :-bit.ly/3MjhZwt
    Servlet :- bit.ly/3Q7eA7k
    Spring Framework :- bit.ly/3xi7buh
    Design Patterns in Java :- bit.ly/3MocXiq
    Docker :- bit.ly/3xjWzLA
    Blockchain Tutorial :- bit.ly/3NSbOkc
    Corda Tutorial:- bit.ly/3thbUKa
    Hyperledger Fabric :- bit.ly/38RZCRB
    NoSQL Tutorial :- bit.ly/3aJpRuc
    Mysql Tutorial :- bit.ly/3thpr4L
    Data Structures using Java :- bit.ly/3MuJa7S
    Git Tutorial :- bit.ly/3NXyCPu
    Donation:
    PayPal Id : navinreddy20
    www.telusko.com
  • Věda a technologie

Komentáře • 41

  • @RaunakKumar-vc5ji
    @RaunakKumar-vc5ji Před 7 měsíci +12

    sir where were u......got a diamond in search of gold♥

  • @devanshusachdev7367
    @devanshusachdev7367 Před rokem +17

    Whoa! so much information in such a small video. Here are the points which I liked the most:
    1. Real values are treated as double by default. We have to explicitly specify float value.
    (Ex.: double d = 5.6 --> no error ; float f = 5.6 --> error)
    2. Only 'true' and 'false' are treated as boolean.
    (Ex.: if(true) --> no error ; if(1) --> error)
    Thanks Navin for the info :)

    • @freddieromero3942
      @freddieromero3942 Před 6 měsíci

      Why does the mac allow the float f = 5.6 and windows only accepts float = 5.6? I can not find this on Google and this course is hard to follow when I am playing follow the leader to a T.

  • @ashishtayade047
    @ashishtayade047 Před 9 měsíci +3

    Thank you sir very nice gide & very nice best java in data type teaching information video..👍

  • @Flo-mz8ct
    @Flo-mz8ct Před rokem +16

    Thanks a lot! I will watch whole series to refresh my java skills :D

  • @zikki8044
    @zikki8044 Před rokem +3

    thank you so much sir...superb explanation..

  • @user-qv9lh1bs4h
    @user-qv9lh1bs4h Před 4 měsíci

    Thanks ,great explanation in detail and in a simple way to understand

  • @deviprasadgm
    @deviprasadgm Před 11 měsíci +1

    Thank you Sir...............Excellent Explanation

  • @Ecto993
    @Ecto993 Před 9 měsíci +1

    really helpful, thanks !

  • @user-op6xr2di2e
    @user-op6xr2di2e Před 11 měsíci +2

    Thank You Sir ❤

  • @rupaliminati8356
    @rupaliminati8356 Před rokem +2

    quality content 🙌

  • @LO3.
    @LO3. Před 11 měsíci +2

    GOOD EXPLATIONS

  • @user-gd4in5pg8o
    @user-gd4in5pg8o Před 11 měsíci +1

    Thank you

  • @rojalindhar899
    @rojalindhar899 Před rokem +2

    It's vry helpful👍💯

  • @arthdaware05
    @arthdaware05 Před 5 měsíci

    Keypoints:
    1. default: double (8bytes) not float
    2. char datatype: only one character and single quotes are allowed
    3. write f at the end of float, l at the end of long
    4. byte range: [-128 , 127]

  • @abinayas6221
    @abinayas6221 Před rokem +2

    when ur printing input output is not print syout how u get output

  • @user-gd4in5pg8o
    @user-gd4in5pg8o Před 11 měsíci +2

    May you please make a video series on making a 3d Game Engine with Java
    Please update when you do

  • @SP-un3rj
    @SP-un3rj Před rokem +4

    Thank you sir Please Try To upload Servlet, JSP And Spring Videos Also In 2023

  • @mohammadaboonajmi2927
    @mohammadaboonajmi2927 Před měsícem +1

    Hi do you have C# tutorial?

  • @HarshPatel-so7gl
    @HarshPatel-so7gl Před 7 měsíci

    why can you put only one character/letter/number in the char variable?

  • @deepanshusahu2333
    @deepanshusahu2333 Před měsícem

    Sir i have one question if u all the content of topic is covered in such a small times

  • @theamritjha755
    @theamritjha755 Před rokem +1

    Sir ek baar main hi sare video daal diye aapne 😅

  • @Magicpeach01
    @Magicpeach01 Před 21 dnem

    Im getting error constantly says
    Could not find pr load main class Hello
    Class not found what should i do??

  • @actandrepeat
    @actandrepeat Před rokem +25

    Sick series to watch in 2023^

  • @4nsaririzz149
    @4nsaririzz149 Před rokem +3

    I am first viewer on this video

  • @siddamallayyahiremath6707
    @siddamallayyahiremath6707 Před měsícem

    i am searching for advanced java can u help me??

  • @akvloggsofficial
    @akvloggsofficial Před rokem +2

    Awesome

  • @martinamillo969
    @martinamillo969 Před 9 měsíci +3

    I wrote this code and cant get what is wrong with it
    class Hello
    {
    public static void main(String a[])
    {
    Char c = ‘k’;
    System.out.print(c);
    }
    }
    when i compile it , it shows these errors
    Hello.java:5: error: illegal character: '\u00b4'
    Char c = ┬┤k┬┤;
    ^
    Hello.java:5: error: illegal character: '\u00b4'
    Char c = ┬┤k┬┤;
    ^
    Hello.java:5: error: not a statement
    Char c = ┬┤k┬┤;
    ^
    3 errors
    How to resolve?

    • @mayankraj4763
      @mayankraj4763 Před 8 měsíci +1

      C of char should be small, not capital

    • @bethesuper4500
      @bethesuper4500 Před 7 měsíci

      it is System.out.println, not print

    • @HarshPatel-so7gl
      @HarshPatel-so7gl Před 7 měsíci +1

      @@bethesuper4500 println just means print on new line, so that isn't major issue. but it is easier with println.

    • @Magicpeach01
      @Magicpeach01 Před 21 dnem

      Same I'm getting continuous errors don't know why 😢😢😢

  • @AntarikshRajkonwar
    @AntarikshRajkonwar Před 2 měsíci

    12/5/24

  • @kittu0132
    @kittu0132 Před rokem +3

    what you are typing to compile in terminal . i'm not getting you there

    • @notshubhm
      @notshubhm Před rokem +6

      First he types "javac" to compile the problem and if the program is compiled successfully without any errors then he types the program name. For example "Hello".

    • @yeswanthkumarnelli2099
      @yeswanthkumarnelli2099 Před 4 měsíci +1

      Here is a total code
      class Hello{
      public static void main(String args[]){
      char c = 'k';
      System.out.print(c);
      }
      }
      After you write this
      Do this in your Terminal
      javac Hello.java
      java Hello
      Then your output will come.

  • @razakshaik5751
    @razakshaik5751 Před měsícem

    where is reference data types

  • @sreesanth20
    @sreesanth20 Před 2 měsíci

    class Hello
    {
    public static void main(String a[])
    {
    System.out.println(3 + 5);
    }
    }
    for this code i get this "Hello world"

    • @sa_____i149
      @sa_____i149 Před měsícem

      You have to run the code first then you will get the result