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.
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.
Hello guys , feel free to comment if there is any problem.
ReplyDeletePlease upload week 2 of cpp
ReplyDeleteWEEK 2 OF CPP HAS BEEN UPLOADED
Delete