Core Java Programming Challenges #2 | Coding Challenges | Naresh IT

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024
  • Core Java Programming Challenges #2 | Coding Challenges | Naresh IT
    ** For Online Training Registration: goo.gl/r6kJbB ► Call: +91-8179191999
    💡 Also Watch
    C Language Tutorials: goo.gl/qDhJ2r
    Core Java FAQ's: goo.gl/qGh5mA
    Core Java Tutorials: goo.gl/NbaEge
    Java Programming Tutorials by Mr.Hari krishna:
    goo.gl/HThq6H
    Advanced Java Programming Tutorials by Mr.Nataraj:
    goo.gl/1U2Qgy
    Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.
    💡 Visit Our Websites
    For Classroom Training: nareshit.in/co...
    For Online Training: nareshit.com/c...
    #CoreJava_Programing #Challenges #CoreJava #Quiz
    --------------------------
    💡 About NareshIT:
    "Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations
    --------------------------
    💡 Our Online Training Features:
    🎈 Training with Real-Time Experts
    🎈 Industry Specific Scenario’s
    🎈 Flexible Timings
    🎈 Soft Copy of Material
    🎈 Share Videos of each and every session.
    --------------------------
    💡 Please write back to us at
    📧 us.training@nareshit.com/ 📧 online@nareshit.com or Call us at the USA: ☎+1404-232-9879 or India: ☎ +918179191999
    --------------------------
    💡 Check The Below Links
    ► For Course Reg: goo.gl/r6kJbB
    ► Subscribe to Our Channel: goo.gl/q9ozyG
    ► Circle us on G+: plus.google.co...
    ► Like us on Facebook: / nareshit
    ► Follow us on Twitter: / nareshitek
    ► Follow us on Linkedin: goo.gl/CRBZ5F
    ► Follow us on Instagram: goo.gl/3UXYK3

ความคิดเห็น • 86

  • @SaritaSinghsarita
    @SaritaSinghsarita 4 ปีที่แล้ว +6

    public class challange2 {
    public challange2() {
    System.out.println("First Constructor");
    }
    public challange2(int i) {
    this();
    System.out.println("Second Constructor - " + i);
    }
    public challange2(int j,String k) {
    this(2);
    System.out.println("Third Constructor " + j +" " + k);
    }
    public static void main(String[] args) {
    new challange2(20,"Main");
    }
    }
    OutPut:
    First Constructor
    Second Constructor - 2
    Third Constructor 20 Main

    • @Naninaninani5209
      @Naninaninani5209 4 หลายเดือนก่อน

      Mam why your using this() in program

  • @saravanakumaran555
    @saravanakumaran555 5 ปีที่แล้ว +23

    instead of giving this kind of challenges give complete code explanation on core java that srinivas sir given for data structure and c programming
    we also want mr. srinivas to give lectures on c++ and core java

    • @AlphaGeekOfficial
      @AlphaGeekOfficial 2 ปีที่แล้ว +2

      yes Mr, Srinivas Explanation is amazing! Please teach core java
      Request from all students

  • @nishantraj3869
    @nishantraj3869 2 ปีที่แล้ว +7

    public class Index {
    Index(){
    this("abc");
    System.out.println("Constructor with no argument ");
    }
    Index(String s){
    this(5,"abc");
    System.out.println("Constructor with one argument ");
    }
    Index(int a, String s){
    System.out.println("Constructor with Two argument");
    }
    public static void main(String[]args)
    {
    Index trial = new Index();
    }
    }

    • @My_music_dinuka
      @My_music_dinuka 4 หลายเดือนก่อน

      we can't make methods without use "public static void "
      This is the correct java program..
      //////////////////////////////////////////////////////////////////////
      public class Example{
      public static void Index(){
      Index("abc");
      System.out.println("
      ");
      System.out.println("Constructor with no argument
      This is the Index methord 1");
      }
      public static void Index(String s){
      Index(5,"abc");
      System.out.println("
      ");
      System.out.println("Constructor with one argument
      This is the Index methord 2 with one parameter. ");
      System.out.println("s :" + s);
      }
      public static void Index(int a, String s){
      System.out.println("
      ");
      System.out.println("Constructor with Two argument
      This is the Index methord 3 with two parameters.");
      System.out.println("a :" + a);
      System.out.println("s :" + s);
      }
      public static void main(String[]args)
      {
      Index();
      }
      }
      //////////////////

  • @codejayam6025
    @codejayam6025 5 ปีที่แล้ว +6

    public static void main(String[] args){
    Test t =new Test(10,20);
    }
    Test(int x,int y)
    {
    this.Test(x);
    }
    Test(int x)
    {
    this.Test();
    }

  • @SubhamKumar-wb5cj
    @SubhamKumar-wb5cj 4 ปีที่แล้ว +4

    sir please check:
    public class Challenge_2 {
    public Challenge_2()
    {

    System.out.println("hi");
    }
    public Challenge_2(int x)
    {
    this();
    System.out.println("hello");
    }
    public Challenge_2(int i,int j)
    {
    this(i);
    System.out.println("bye bye");
    }
    }
    class UseChallenge_2{
    public static void main(String[] args) {
    Challenge_2 obj=new Challenge_2(2,3);
    }
    }

    • @RRRdaemon
      @RRRdaemon 4 หลายเดือนก่อน

      yes perfect 👍

  • @ShivaniSharma-fp7gy
    @ShivaniSharma-fp7gy 4 ปีที่แล้ว +5

    Sir please provide code afterwards... So that we can check.

  • @danyalaabid
    @danyalaabid 5 ปีที่แล้ว +7

    public class Challenge2
    {
    Challenge2()
    {
    System.out.println("Hi");
    }
    Challenge2(int x)
    {
    this();
    System.out.println("Hello");
    }
    Challenge2(int x, int y)
    {
    this(5);
    System.out.println("Bye");
    }
    public static void main(String []args){
    new Challenge2(5,6);
    }
    }

    • @jayakrishnavunnam9335
      @jayakrishnavunnam9335 5 ปีที่แล้ว

      Bro its getting error. It is saying that "this();" should be on first line.

  • @arabindamohanty2190
    @arabindamohanty2190 4 ปีที่แล้ว +3

    Thanks a lot for such a wonderful session s

  • @jyotisankardas2036
    @jyotisankardas2036 5 ปีที่แล้ว +4

    public class Main
    {
    public Main(){
    this(10);
    System.out.println("hi");
    }
    public Main(int x){
    this(2,6);
    System.out.println("hello");
    }
    public Main(int z,int y){
    System.out.println("by");
    }
    public static void main(String[] args)
    {
    Main m=new Main();
    }
    }

    • @Gamingrobox11
      @Gamingrobox11 ปีที่แล้ว

      great which company are u working brother

  • @sarmadrehman3304
    @sarmadrehman3304 2 ปีที่แล้ว +1

    class Temp {
    Temp () {
    this( 5) ;
    System.out.println("Default");
    }
    Temp(int x){
    this (5,10);
    System.out.println("first");
    }
    Temp (int x, int y){
    int c= x*y;
    System.out.println(c);
    System.out.println("second");
    }
    }
    public class Main {
    public static void main(String[] args)
    {Temp T = new Temp();
    }}

  • @vivektiwari372
    @vivektiwari372 4 ปีที่แล้ว +9

    class Test
    {
    Test()
    {
    this(5);
    System.out.println("Hii");
    }
    Test(int x)
    {
    this(5,15);
    System.out.println("Hello");
    }
    Test(int x,int y)
    {
    System.out.println("Bye");
    }
    public static void main(String args[])
    {
    Test t1=new Test();
    }
    }

  • @sreedharkamera9553
    @sreedharkamera9553 5 ปีที่แล้ว

    public class reversestring {

    int x=10;
    int y=20;
    reversestring()
    {

    System.out.println("Default constructor");
    }
    reversestring(int x)
    { this();
    System.out.println("single instance constrctor");
    }
    reversestring(int x,int y)
    {
    this(10);
    System.out.println("Multiple instance constrctor");
    }

    public static void main(String[] args)
    {
    reversestring rev= new reversestring(10,20);
    }
    }

  • @haidarsalami355
    @haidarsalami355 5 ปีที่แล้ว +2

    very good pleas go on

  • @manojpal-kb8cj
    @manojpal-kb8cj ปีที่แล้ว

    package challenges;
    public class challange_2 {
    challange_2() {
    System.out.println("hi");
    }
    challange_2(int x){
    this();
    System.out.println("hello");
    }
    challange_2(int x, int y ){
    this(10);
    System.out.println("bye");
    }
    public static void main(String[] args) {
    challange_2 c2=new challange_2(10,20);
    }
    }

  • @mdsarfarazansari3844
    @mdsarfarazansari3844 5 ปีที่แล้ว +2

    Test obj=new Test();
    obj.Test();
    obj.Test(2);
    obj.Test(2,3);

    • @SaiTechSolutions
      @SaiTechSolutions 5 ปีที่แล้ว +1

      for constructors no need to create new objects when we call them automatically execution get started :)

    • @navyamudadla4184
      @navyamudadla4184 4 ปีที่แล้ว +2

      public class Test{


      Test()
      {
      System.out.println("hi");

      }
      Test(int x)
      {
      System.out.println("hlo");

      }
      Test(int x,int y)
      {
      System.out.println("hieeee");
      }

      public static void main(String[] args) {
      Test t=new Test(5,5);
      Test k=new Test();
      Test s=new Test(7);



      }
      }
      This is the crct answer

    • @yaswanth2332
      @yaswanth2332 4 ปีที่แล้ว

      @@navyamudadla4184 but Srinivas sir told take only one object.bro u took 3 objects

  • @manojpal-kb8cj
    @manojpal-kb8cj ปีที่แล้ว

    this keyward is refrence variable that refer to the ✔✔✔current object✔✔✔ not a present object

  • @pankajaklade9963
    @pankajaklade9963 2 ปีที่แล้ว

    class A
    {
    A()
    {
    System.out.println("this is default contsructor");
    }
    A(int x,int y)
    {
    this();
    System.out.println("this is two int constructor : "+x+" "+y);
    }
    A(String x,double y)
    {
    this(10,20);
    System.out.println("this is string and float type constrctor : "+x+" "+y);
    }
    }
    public class Test {
    public static void main(String[] args) {

    A a = new A("pankaj",10.25);
    }
    }

  • @arpithaarpithak1699
    @arpithaarpithak1699 5 ปีที่แล้ว +4

    Sir what is the difference between Java and core java

    • @sandeepjoshivlogs5227
      @sandeepjoshivlogs5227 4 ปีที่แล้ว +4

      Nothing, two types of java..
      1.core java. Which is basic java.
      2. Advance java. like servlet, spring, hibernate etc etc...

    • @prasadamara7633
      @prasadamara7633 3 ปีที่แล้ว +4

      Java is derived by 3 types jse jee jme 1.jse means core java, we develop only standalone applications 2.jee means adv java ,we develop web applications and online applications. 3.jme we develop mobile applications and games

  • @snletwang6994
    @snletwang6994 ปีที่แล้ว

    public class test {
    test(){
    this(1);
    System.out.println("Hi");
    }
    test(int a){
    this(1,2);
    System.out.println("hello");
    }test(int a, int b){

    System.out.println("Bye");
    }
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    test t = new test();
    }

  • @kaviapnasuno7011
    @kaviapnasuno7011 ปีที่แล้ว

    package p1;
    public class A {

    A(){
    System.out.println("Hi");
    }
    A(int a){
    this();
    System.out.println("Hello");
    }
    A(int b , String str){
    this(20);
    System.out.println("bye");

    }
    public static void main(String[] args) {
    A a1=new A(10,"santosh");
    }

    }

  • @poonampatel-cn3ge
    @poonampatel-cn3ge 9 หลายเดือนก่อน

    class Challang2{
    public Challang2(){
    System.out.println("hi");
    }
    public Challang2(int a){
    this();
    System.out.println("welcom");
    }
    public Challang2(int a,int b){
    this(3);
    int c=a+b;
    System.out.println("hi"+c);
    }
    public static void main(String [] ar){
    new Challang2(4,7);
    }
    }

  • @psnvenkat2284
    @psnvenkat2284 8 หลายเดือนก่อน

    package CodeChallangenaresh;
    public class ConstructorChaininig {
    ConstructorChaininig() {
    System.out.println("1");
    }
    ConstructorChaininig(int x) {
    this();
    System.out.println("2");
    }
    ConstructorChaininig(int x, int y) {
    this(x);
    System.out.println("3");
    }
    public static void main(String[] args) {
    ConstructorChaininig obj = new ConstructorChaininig(2,3);

    }
    }

  • @shilpar2298
    @shilpar2298 ปีที่แล้ว

    public class SameClass {

    SameClass()
    {
    System.out.println("hello");
    }
    SameClass(int arg)
    {
    this();
    System.out.println("hi");
    }
    SameClass(int arg1, int arg2)
    {
    this(29);
    System.out.println("Bye");
    }
    public static void main(String[] args) {
    SameClass s= new SameClass(10,20);
    }
    }

  • @sarthaksinghnegi1494
    @sarthaksinghnegi1494 4 ปีที่แล้ว

    class A
    {
    A()
    {
    this(10);
    }
    A(int a)
    {
    System.out.println("Completed");
    }
    public static void main(String...s)
    {
    new A();
    }
    }

  • @raviraj1644
    @raviraj1644 4 ปีที่แล้ว

    public class Test7 {
    Test7() {
    this(10);
    System.out.println("0 Param construtor is called");
    }
    Test7(int x) {
    this(12, 15);
    System.out.println("1 int Param construtor is called");
    }
    Test7(int x, int y) {
    System.out.println("2 Param construtor is called");
    }
    public static void main(String[] args) {
    Test7 test = new Test7();
    }
    }

  • @RahulGupta-xc4fg
    @RahulGupta-xc4fg 4 ปีที่แล้ว

    Public class xyz()
    {
    xyz() {
    S. O. P("No parameter constructor is called") ;
    Test(10) :
    }
    Xyz(int a)
    {
    Sysout("constructor with one parameter is called") ;
    Test(65,78)
    }
    Xyz(int a, int b)
    { Sysout("constructor with two parameter is called") ;
    }
    P. S. V. M(String arga[])
    {
    new xyz() ;
    }
    }
    // Now all the three constructor will get called at once

  • @dineshseven3239
    @dineshseven3239 ปีที่แล้ว

    public class Challenge2 {

    Challenge2(){
    System.out.println("Hi");
    }

    Challenge2(int a){
    this();
    System.out.println("Hello ");
    }


    Challenge2(int b, int c){
    this(b);
    System.out.println("Bye");
    }

    public static void main(String[] args) {
    /* Constructor chaining
    QUESTION: Connect all the three constructors in Object creation
    */

    Challenge2 c2 = new Challenge2(10,20);
    }
    }

  • @samahmahdi5511
    @samahmahdi5511 6 หลายเดือนก่อน

    class Challenge2{
    Challenge2(){
    System.out.println("Default constructor");
    }
    Challenge2(String s){
    this();
    System.out.println("One argument constructor with parameter "+s);
    }
    Challenge2(String s1 , String s2){
    this(s1);
    System.out.println("Two argument constructor with parameter "+s1+ " and "+s2);
    }
    public static void main(String args[]){
    Challenge2 obj = new Challenge2("Hello", "World");
    }
    }

  • @karangorai4401
    @karangorai4401 3 ปีที่แล้ว

    public class Challenges2 {
    Challenges2(){
    System.out.println("Hi");
    }
    Challenges2(int x){
    this();
    System.out.println("Hello");
    }
    Challenges2(int x,int y){
    this(1);
    System.out.println("Bye");
    }
    public static void main(String[] args) {
    Challenges2 ch = new Challenges2(3,4);
    }
    }

  • @srinivasvenkata9069
    @srinivasvenkata9069 5 ปีที่แล้ว

    class ConstructorTest
    {
    ConstructorTest(){
    this(1);
    System.out.println("Hi");
    }
    ConstructorTest(int x){
    this(1,2);
    System.out.println("Hello");
    }
    ConstructorTest(int x,int y){

    System.out.println("Bye");
    }
    public static void main(String[] args)
    {
    ConstructorTest t=new ConstructorTest();
    //System.out.println("Hello World!");
    }
    }

  • @RahulKumar-zr5gu
    @RahulKumar-zr5gu 5 ปีที่แล้ว +1

    what if , i cant code please also give codings at last or in another video or in comments... please

  • @RajuChippa
    @RajuChippa 5 ปีที่แล้ว

    public class PrintEx {
    public PrintEx() {
    this(10);
    }
    public PrintEx(int a) {
    this(10,20);
    }
    public PrintEx(int a, int b) {
    int c=a+b;
    System.out.println("abc "+ c);
    }
    public static void main(String[] args) {
    System.out.println("Hi
    Hello
    Wecome");
    PrintEx pr = new PrintEx();
    }
    }

  • @SaiTechSolutions
    @SaiTechSolutions 5 ปีที่แล้ว +2

    class Test {
    Test() {
    System.out.println("Hai");
    }
    Test(int x) {
    this();
    System.out.println(x);
    }
    Test(int x,int y) {
    this(5);
    System.out.println(x + y);
    }
    }
    class Sai {
    public static void main (String[] args) {
    new Test(5,5);
    }
    }

  • @mdtausifiqbal
    @mdtausifiqbal 5 ปีที่แล้ว

    public class Main
    {
    public static void main(String[] args)
    {
    Test a = new Test(1,2);
    }
    static class Test{
    Test(){
    this(0);
    }
    Test(int a){
    this(a,0);
    }
    Test(int a, int b){
    System.out.println(a + b);
    }
    }
    }

  • @hangoutbuddy
    @hangoutbuddy 5 ปีที่แล้ว

    public class Test
    {
    Test()
    {
    System.out.println("Hi");
    }
    Test(int x)
    {
    this(); //calls zero arg con
    System.out.println("Hello");
    }
    Test (int x,int y)
    {
    this(30); //calls int arg con
    System.out.println("Bye");
    }
    public static void main(String[] args) {
    Test t=new Test(10,20); //object created and calls int,int param con
    }
    }

  • @devrajsinghchouhan8219
    @devrajsinghchouhan8219 2 ปีที่แล้ว

    class Main {
    Main()
    {
    this(3);
    System.out.println("Default Constructor");
    }
    Main(int x)
    {
    this(3,8);
    System.out.println(x +"\t Calling Parameterised Constructor with one value");
    }
    Main(int x, int y)
    {

    System.out.println(x*y +"\t Calling Parameterised Constructor with Two value multiplication" );
    }
    public static void main(String[] args) {
    //System.out.println("
    Hello" + "\tHi" + "
    Bye");
    new Main();

    }

    }

  • @rajeshpro2243
    @rajeshpro2243 ปีที่แล้ว

    class Main{
    private int age;
    private int height;
    private String name;
    public Main(int height){
    //this.height = height;
    this(height, 23, "Rajesh");
    }
    public Main(int height, int age, String name){
    this.height=height;
    this.age = age;
    this.name = name;
    }
    public void printValues(){
    System.out.println("name: "+name);
    System.out.println("age: "+age);
    System.out.println("height: "+height);
    }
    public static void main(String[] args){
    Main obj = new Main(180);
    obj.printValues();
    }
    }

  • @mohamedfayazudeenj5762
    @mohamedfayazudeenj5762 5 ปีที่แล้ว

    class Test
    {
    Test()
    {
    sysout("hi");
    }
    Test(x)
    {
    this();
    sysout(x);
    }
    Test(x,y)
    {
    this(8);
    sysout(x*y);
    }
    psvm(string args[])
    {
    new Test(2,4);
    }
    }

  • @ManojKumar-po5ds
    @ManojKumar-po5ds 5 ปีที่แล้ว +2

    package VerifyCodingSkills;
    public class Program2 {
    Program2()
    {
    System.out.println("hi");
    }
    Program2(int a)
    {
    this();
    System.out.println("hello");
    }
    Program2(int a,String s)
    {
    this(10);
    System.out.println("Bye");
    }
    public static void main(String[] args)
    {
    Program2 p2 = new Program2(7,"Max");

    }
    }

  • @jagadishmahato3361
    @jagadishmahato3361 7 หลายเดือนก่อน

    😊😊

  • @narsireddygade5413
    @narsireddygade5413 4 ปีที่แล้ว

    import java.util.Scanner;
    public class DuplicateArray
    {
    public static void main(String[] args)
    {
    Scanner s = new Scanner(System.in);
    System.out.println("Enter the size of an Array...");
    int arr[] = new int[s.nextInt()];
    System.out.println("Enter "+arr.length+" elements for the array...");
    for(int i=0;i

  • @simpleprogramms9769
    @simpleprogramms9769 5 ปีที่แล้ว

    import java.util.*;
    class Challenge2
    {
    public static void main(String[] args)
    {
    Scanner sc=new Scanner(System.in);
    System.out.print("Enter the number:");
    int a=sc.nextInt();
    if(a%2!=0)
    System.out.println("Hello");
    else if(a>=0 && a=10 && a20)
    System.out.println("Bye");

    }
    }

  • @akshaygupta9976
    @akshaygupta9976 5 ปีที่แล้ว

    Easy task

  • @akshaygupta9976
    @akshaygupta9976 5 ปีที่แล้ว

    Give some challenging

  • @vishaljadhav4720
    @vishaljadhav4720 4 ปีที่แล้ว +1

    public class P2 {
    P2()
    {
    this(10);
    System.out.println("Hii");
    }
    P2(int x)
    {
    this(10,20);
    System.out.println("Hello");
    }
    P2(int x, int y)
    {
    System.out.println("Bye");
    }
    public static void main(String[] args) {

    P2 obj=new P2();
    }
    }

  • @vikasdubbaka7582
    @vikasdubbaka7582 5 ปีที่แล้ว +1

    public class Challenge2 {
    public Challenge2() {
    System.out.println("Constructor-1");
    }
    public Challenge2(int x) {
    this();
    System.out.println("Constructor-2");
    }
    public Challenge2(int y, int z) {
    this(5);
    System.out.println("Consttructor-3");
    }
    public static void main(String[] args) {
    Challenge2 ch = new Challenge2(5, 7);
    }
    }

  • @SaiTechSolutions
    @SaiTechSolutions 5 ปีที่แล้ว +1

    class Test {
    Test() {
    System.out.println("Hai");
    }
    Test(int x) {
    System.out.println(x);
    }
    Test(int x,int y) {
    System.out.println(x + y);
    }
    }
    class Sai {
    public static void main (String[] args) {
    new Test();
    new Test(5);
    new Test(5,5);
    }
    }

  • @HappyDaysINDIA
    @HappyDaysINDIA 5 ปีที่แล้ว +1

    class Test{
    Test() {
    System.out.println("This is Test");
    }
    Test(int x){
    this();
    System.out.println("This is Test "+x);
    }
    Test(int x,int y){
    this(20);
    System.out.println("This is Test "+x+" "+y);
    }
    }
    public class ConstructorCalling {
    public static void main(String[] args) {
    Test t = new Test(10,15);
    }
    }

  • @jyothichinthapally5825
    @jyothichinthapally5825 5 ปีที่แล้ว

    I did not understand the concept

  • @sreedharkamera9553
    @sreedharkamera9553 4 ปีที่แล้ว

    public final class Test
    {
    Test(int x,int y)
    {
    this(x);
    System.out.println("third con:"+x + "y valye:"+y);
    }
    Test(int x)
    {
    this();
    System.out.println("second contrsotr"+x);
    }
    Test()
    {
    System.out.println("first construtor");
    }
    public static void main(String[] args){
    Test t =new Test(10,20);
    }
    }

  • @chanchalsahu7150
    @chanchalsahu7150 5 ปีที่แล้ว

    public class PC2
    {
    PC2()
    {
    //PC2(); //CE: cannot find symbol
    //this(); //CE:recursive constructor invocation
    //this(10);
    System.out.println("Constructor Called");
    }
    PC2(int x)
    {
    this();
    }
    PC2(String name, int roll)
    {
    this(10);
    }
    public static void main(String[] args)
    {
    System.out.println("Main Method");
    PC2 obj1=new PC2();
    PC2 obj2=new PC2(10);
    PC2 obj3=new PC2("KundaN",10);
    }

    }

  • @satishkumar-bf3jy
    @satishkumar-bf3jy 5 ปีที่แล้ว

    package interview;
    public class ConstruterChanning
    {
    public ConstruterChanning()
    {
    this(1,2);
    System.out.println("hii");
    }

    public ConstruterChanning( int x)
    {
    this();
    System.out.println("hellow");

    }
    ConstruterChanning( int x,int y)
    {


    System.out.println("satish");
    }
    public static void main(String[] args)
    {
    new ConstruterChanning(10);


    }
    }

  • @vaibhavshetter9085
    @vaibhavshetter9085 5 ปีที่แล้ว

    Class Test
    {
    Test()
    {
    this(6);
    System.out.println(“hi”);
    }
    Test(int x)
    {
    this(6,7);
    System.out.println(“hello”);
    }
    Test(int x,int y)
    {
    System.out.println(“bye”);
    }
    PSVM()
    {
    Test t=new Test();
    }

  • @sumitjadhav3573
    @sumitjadhav3573 ปีที่แล้ว

    public class ConstructorChaning {
    ConstructorChaning()
    {

    System.out.println("hi");
    }

    ConstructorChaning(int a)
    {
    this();
    System.out.println("hello");
    }

    ConstructorChaning(int a,int b)
    {
    this(12);
    System.out.println("Namaste");
    }
    public static void main(String[] args) {
    new ConstructorChaning(20,23);

    }
    }

  • @nk958
    @nk958 4 ปีที่แล้ว

    package org.example;
    public class App
    {
    private int x;
    private int y;
    public App(int x, int y) {
    this(10);
    this.x = x;
    this.y = y;
    System.out.println("constructor App 2nd");
    }
    public App(int x) {
    this();
    this.x = x;
    System.out.println("constructor App 3rd");
    }
    public App() {
    System.out.println("constructor App 1st");
    }
    public static void main(String[] args )
    {
    App app=new App(10,20);
    }
    }

  • @NareshIT
    @NareshIT  5 ปีที่แล้ว

    If you have any queries, Please ask our experts and Share your precious feedback in the comments, Learn from experts with our Online training Program, visit our website: goo.gl/hNPwDi ,Do not forget to subscribe and hit the bell icon for Future Tutorials updates.

  • @ashwadhreddy5152
    @ashwadhreddy5152 5 ปีที่แล้ว +1

    is this challenging are you feeling wasting time

    • @pankajlilhore
      @pankajlilhore 5 ปีที่แล้ว

      @Srinivas Garapati i am following but didn't found any challenging task or concept

  • @easywaytostudy8061
    @easywaytostudy8061 ปีที่แล้ว

    Java code chalange th-cam.com/users/shortsltgMz_nyZBE?si=jxae4Zp21gArbDwB

  • @danyalaabid
    @danyalaabid 5 ปีที่แล้ว +2

    public class Challenge2
    {
    Challenge2()
    {
    this(5);
    System.out.println("Hi");
    }
    Challenge2(int x)
    {
    this(5,6);
    System.out.println("Hello");
    }
    Challenge2(int x, int y)
    {
    System.out.println("Bye");
    }
    public static void main(String []args){
    new Challenge2();
    }
    }

  • @vinaykoudagani787
    @vinaykoudagani787 6 หลายเดือนก่อน

    package p1;
    public class Challenge2 {
    Challenge2(){
    System.out.println("Hi");

    }
    Challenge2(int x){
    this();
    System.out.println("Hello");
    }
    Challenge2(int x , int y){
    this(10);

    System.out.println("Bye");
    }
    public static void main(String[] args) {
    Challenge2 ob = new Challenge2(10,20);


    }
    }

  • @shitaldhavale7141
    @shitaldhavale7141 3 ปีที่แล้ว

    Class Test {
    Test() {
    Test(10) ;
    System.out.println("hi") ;
    }
    Test(int x) {
    Test(10, 20) ;
    System.out.println("hello") ;
    }
    Test(int x, int y) {
    System.out.println("bye") ;
    }
    public static void main(String [ ] args) {
    Test t = new Test() ;
    }
    }

    • @Kafi_relatable
      @Kafi_relatable 4 หลายเดือนก่อน

      why did you use test(10) in 3rd line and test(10,20) in 7th line

  • @AktherBrothersOfficial
    @AktherBrothersOfficial ปีที่แล้ว

    public class Main
    {
    public Main() {
    this(5);
    System.out.println("Bye");
    }
    public Main(int x) {
    this(5, 2);
    System.out.println("Hello");
    }
    public Main(int x, int y) {
    System.out.println("Hi");
    }
    public static void main(String[] args) {
    Main m = new Main();
    }
    }

    • @Kafi_relatable
      @Kafi_relatable 4 หลายเดือนก่อน

      why did you use this(5) an d this(5,2) what is use of 5 and 2

    • @AktherBrothersOfficial
      @AktherBrothersOfficial 3 หลายเดือนก่อน

      @@Kafi_relatable Calling the constructor of Main. And depending on the number of arguments like (5) or (5,2), an appropriate constructor is called.

  • @Yogesh-ld2js
    @Yogesh-ld2js 2 ปีที่แล้ว

    class Challenge2{
    Challenge2(){
    System.out.println("Hi");
    }
    Challenge2(int x){
    this();
    System.out.println("Hello");
    }
    Challenge2(int x,int y){
    this(2);
    System.out.println("Bye");
    }
    public static void main(String[] args) {
    Challenge2 ch=new Challenge2(1,2);
    }
    }

  • @arbajshaikh
    @arbajshaikh 5 ปีที่แล้ว

    class Challenge2
    {
    Challenge2(){
    System.out.println("Hi");
    }
    Challenge2(int x){
    this();
    System.out.println("Hello");
    }
    Challenge2(int x,int y){
    this(10);
    System.out.println("Bye");
    }
    public static void main(String[] args)
    {
    Challenge2 challenge = new Challenge2(10,20);
    }
    }