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
GOALS 1.   Use abstract classes in the correct programming context. 2.   Evaluate and use a variety of data structures. 3.   Design, evaluate and implement efficient alg

Project Description: I want to modify Joomla component. Now there is Akeeba subscription component on this site. It works and the whole thing is fine, but there is no "teaser

Question 1 Write a program in Java to find the highest of any five numbers. How do you compile and execute this Java program? Question 2 Write a program to explain the Except

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''''a''''-''''z'''') and

Why are JSP pages the preferred API for creating a web-based client program? Because no plug-ins or security policy files are required on the client systems (applet does). Also,

Explain DATA SECURITY Management issue? All data in the system is extremely critical to its operation, the security of the customer's personal data is most important. Most of t

Write a program that takes as input a sequence of transactions of the form "buy x; share(s) at $y each" or "sell x share(s) at $y each," assuming that the transactions occur on con

try { pa="weblog"; pas="weblog"; Connection c; Statement st;

Describe even higer dimensions in java? You don't have to stop along with two dimensional arrays. Java allows arrays of three, four or more dimensions. Therefore chances are pr

Write a AXIS2 SOAP Java Web Service that performs a bidirectional currency conversion for the following currencies- GBP, EUR and USD (American Dollar). You are allowed to hardco