+ 1
java classes
how can i define classes? is there 3 types of classes like c++ ? public,private and protected? How can they be defined?
2 Respostas
0
those are the access modifiers... and in java we have four access modifiers default, public, private, and protected..
Since java is kind of pure oops you cannot create any method or variable without a class..
so the first thing that we create in java programming is the class
defining class:-
access_modifier class class_name
{
}
look here we don't put a ; after the end of block, as we used to do in c++