Can somebody tell me what does this mean? I’m going trough Java book and I’ve encontered this example :
public class Message {
Message(){}
public Message(String text){
this.text = text;
}
What does Message(){} Mean ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s a package private empty constructor taking no arguments.
You can use it to create a new Message instance from any code in the same package, by using
new Message();.It’s worthwhile to know it will not initialize the
textfield, which will therefore hold the defaultnullvalue.