+ 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?

13th Jun 2017, 9:38 AM
Saleh Sayeem
Saleh Sayeem - avatar
2 Answers
13th Jun 2017, 10:03 AM
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender)
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender) - avatar
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++
13th Jun 2017, 10:13 AM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar