GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Concepts  >  OOPS

 Print  |  
Question:  1.why do we need encapsulation?
2. what is a class in C++ analogous to in C






November 11, 2005 13:44:33 #1
 Diaupo Web Expert  Member Since: November 2005    Total Comments: 1 

what is a class in C++ analogous to in C
 
struct.With C, you can .. struct { char fname[8]; char lname[16]; int age; } student;With Java, you canpublic class record{ public String fname; public String lname; public int age;}
     

 

Back To Question