NPTEL( 14 Sep - 06 Nov )| Week 2 Programming Qs3 and Programming Qs4 Programming in JAVA 2020

 



FOR Q1 AND Q2 CODE CLICK HERE 




        Programming in JAVA.       




Java Week 2: Q3

Complete the code segment to call print() method of class Question by creating a method named ‘studentMethod()’

PROGRAM:

void studentMethod()
{
  print(this);
}


Java Week 2: Q4

Complete the code segment to call default constructor first and then any other constructor in the class

PROGRAM:

class Answer{
	Answer(){
		System.out.println("You got nothing.");
	}
	Answer(int marks, String type){		
      this();
		System.out.println("You got "+marks+" for an "+ type);
	}
}
  FOLLOW OUR WEBSITE FROM THE BUTTON PROVIDED TO THE BOTTOM OF PAGE TO GET SOON ANSWERS OF PROGRAMS.
Disclaimer: Here you can find all nptel assignment solutions related to CS stream.These may help you for your assignment.The answers are only for verification.You cannot copy these directly from the post(code of conduct of NPTEL).These is not 100%  correct solutions.

3 comments:

If you have any problems related to solutions or any concept please let me know.

Copyright (c) 2020 Custom Programs All Right Reserved

Pages