Compare classes of java with c++, JAVA Programming

Compare classes with C++

Some significant points to consider when defining a class in java as you probably noticed from above given skeleton are

-  There  are  no  global  functions or  variables .  Everything  resides  inside  a  class. Remember that we  wrote our  main method  inside  a  class.   (For  instance , in HelloWorldApp program)

-  Specify access modifiers  (public, private or protected)  for every member method or data members at each line.

-  public: accessible anywhere by anyone

-  private: Only accessible within this class

-  protect:  accessible only  to  the  class  itself and  to  it's  subclasses  or other classes in same package.

-  default: default access if no access modifier is provided. Accessible to all classes in same package.

-  There is no semicolon (;) at the end of class.

- All methods (functions) are written inline. There are no separate header and implementation files.

- Automatic initialization of class level data members if you don't initialize them Primitives

o Numeric (int, float etc) with zero

o Char with null

o Boolean with false

Object References

- With null


Posted Date: 9/20/2013 5:15:55 AM | Location : United States

Related Discussions:- Compare classes of java with c++, Assignment Help, Ask Question on Compare classes of java with c++, Get Answer, Expert's Help, Compare classes of java with c++ Discussions

Write discussion on Compare classes of java with c++
Your posts are moderated
Related Questions
This assignment requires you to design, implement and test a program using Java features from the first half of the subject content. You are required to implement in Java all the c

what is join in java Thread

Explain Parentheses in Java ? Sometimes the default sequence of evaluation isn't what you want. For example, the formula to change a Fahrenheit temperature to a Celsius tempera

What is static in java? Static means one per class, not one for each object no matter how many example of a class might exist. This means that you can use them without making a

You are to write a Java console application, following the Software Life Cycle model, which will read personnel records from a text file and store them in a data structure.  One li

Project Description: Introduction: SID C.A. (integradores) is a software company in Venezuela 15 years ago, and we are exploring the possibility of making mobile developments

Project Description: I need Team speak 3 client for Nokia Symbian platform. Project for Nokia E72, but should work on all Java/Symbian mobiles. Feature list should include

Java Server Pages (JSP) is a platform independent presentation layer technology that comes with SUN s J2EE platform. JSPs are normal HTML pages with Java code pieces embedded in th