MCQs > IT & Programming > JSharp - J# > Consider the following class: public class Intro { static int a; int b; public Intro() { int c; c = a; a++; b += c; } public void Intro() { int c; c = a; a++; b += c; } public static void main(String args[]) { new Intro(); } } What will happen on compiling and running this class?

JSharp - J# MCQs

Consider the following class:

public class Intro {
        static int a;
        int b;
    
        public Intro() {
            int c;
            c = a;
            a++;
            b += c;
        }

        public void Intro() {
           int c;
            c = a;
            a++;
            b += c;
        }

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

What will happen on compiling and running this class?

Answer

Correct Answer: The code will compile and runs successfully 

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JSharp - J# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

More JSharp - J# MCQ Questions

search

JSharp - J# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it