Class is a collection of similar objects. Which have common properties. Syntax class class_name { //member functions and variables. } How to create a objects for class class_name c=new class_name; We can access the member variable and member methods using dot operator. c.member_function(); Eg : class bike { void fun() { System.out.println("member method"); } public static void main(String[] args) { bike B=new bike(); B.fun(); } } output member method
dsaJavaCpp Is a Personnel Blog To Learn Basic Programming Data structures and Algorithms For Develop My Programming Skills And Prepare coding Interview. The Blog Contains Basic Algorithms Such As, Divide and Con quire, Linear And non Linear Data Structures.
Comments
Post a Comment