public class Message {
String msg;
int noOfWords;
public Message() {
msg += " Thank you";
}
public Message(int noOfWords) {
this.noOfWords = noOfWords;
msg = "Welcome";
Message();
}
public static void main(String args[]) {
Message m = new Message(5);
System.out.println(m.msg);
}
}
What will be the output ?
Answers
Answered by
0
Explanation:
public class Message {
String msg;
int noOfWords;
public Message() {
msg += " Thank you";
}
public Message(int noOfWords) {
this.noOfWords = noOfWords;
msg = "Welcome";
Message();
}
public static void main(String args[]) {
Message m = new Message(5);
System.out.println(m.msg);
}
}
What will be the output ?
output will be
stringing printing
Similar questions
Hindi,
1 month ago
Computer Science,
3 months ago
English,
3 months ago
Math,
10 months ago
Math,
10 months ago