Java does not have #define; or any other kind of macro support; as it
does not even have the concept of pre processing.
Given your comments: first of all, you really want to step back. You don't learn Java by applying your C knowledge. Period. There is many existing documentation out there that summarizes the important differences between C and Java; you start by searching and reading such stuff.
Then: the real difference is that Java is a (heavily, but not 100%) object oriented programming language; and C is not. So you not only change syntax elements; you apply different concepts. One first starting point here would be the SOLID principles.
And then there are subtle things, such as Java coding style guides - that instruct for simple things as "no _ chars in variable names" (except for SOME_CONSTANT).
And regarding your example, a simple example would look like:
public class Class {
private final static int MAX_COUNT_OF_STUDENTS = 50;
private int numberOfStudents;
private int numberOfBooks;
public void setNumberOfStudents(int newCount) {
numberOfStudents = newCount;
}
public boolean isFull() {
return ( numberOfStudents <= MAX_COUNT_OF_STUDENTS );
}
...
That is how you would approach such things in Java. There key thing is to design classes that represent the objects in the real world you intend to model; to add the required behavior as methods.
And beyond that: even in the C world I would be really really cautious about using #defines this way. Yes, they are convenient and have their place; but using them just to safe typing word like in your example I would consider a bad practice.