Java Tricky Code Snippets | Tricky Java Interview Questions | Find output of Java program | Part- 1

Поделиться
HTML-код
  • Опубликовано: 16 янв 2022
  • Hi All,
    In this video we will discuss some of he code snippets of java and will find out the output. This are the questions which are already asked in some big companies interview so please watch the video till the end.
    If you like my video please share with your friends and Subscribe to the channel for such more videos.
    #sjprogrammingsolutions #javacoding #javacodesnipets #findtheoutputqestions #javainterview #mastercard #accenture #neosofttechnologies #epam
    Thank you !

Комментарии • 5

  • @Shivakumar_Kamanaboina
    @Shivakumar_Kamanaboina Год назад

    What is the Output of Code Snippets
    String s1 = "abc":
    String s2 = "abc";
    System.out.printIn("s1 == s2 is:" + s1 == s2);

    • @SJProgrammingSolutions
      @SJProgrammingSolutions  Год назад +1

      s1==s2 is : false

    • @carrybhai9073
      @carrybhai9073 Год назад

      @@SJProgrammingSolutions true

    • @SJProgrammingSolutions
      @SJProgrammingSolutions  Год назад +1

      @@carrybhai9073 The answer to the above questio is false because == operator is ment for reference comparison and s1 and s2 both have different references hence it will print false if we use equal method here then answer will be true bcpz equals method is for content comparison.

    • @wifu_ssgaf
      @wifu_ssgaf 9 месяцев назад +1

      ​@@SJProgrammingSolutions answer is true. Since both the string literals point to the same memory location in SCP. So the output will be true