Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Data Structures Getting There Class Review

sandro mirijanashvili
sandro mirijanashvili
2,686 Points

Very disappointed that i am asked to make mAuthor. i wanted to make it without m and then use this.author!

i Could do it without m and it would be correct!!!

com/example/BlogPost.java
package com.example;

import java.util.Date;

public class BlogPost {

private String authro;
private String title;
private String body;
private String category;
private Date creationDate;

}

1 Answer

Hello

You could use mAuthor, author, auth, writer, .... whathever you want .... they will all work

the instructor is teaching a convention of adding m (stand for member) for mebe variables.

some folks follow this convention, some don't... even the instructor, is some later courses does not use this convention.

some folks like the m because when they see something like mAuther ... they know it is a member of the class variable and most likely have a getter and a setter ... I tend to like it, even though I don't do that often.