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
Question Using 3 level of nested for loop, write a program that will produce the output as below.

Java platform is a software-only platform independent, which runs on top of other hardware-based platforms like WINDOWS, UNIX, NT etc.   The Java platform has 2 main com


Explain the Order of Evaluation of Logic Operators ? When Java sees a && operator or a ||, the expression on the left side of the operator is evaluated first. For instance, con

I want someone to help me prepare a simple inventory system. I am not a programmer trying to learn as i go. Skills required: Android, Java, iPhone, Mobile Phone, Objective

Project Description: i am seeking an experienced Facebook page builder,fanpage builder, Header module Navigation menu module HTML module Widget module Image modul

(CarbonFootprint Interface: Polymorphism) Using interfaces, as you learned in this chapter, you can specify similar behaviors for possibly disparate classes. Governments and compan

You are asked to write a Java program to calculate the commercial value of the stamps owned by a philatelist. Each philatelist has a name and a collection of stamps. The stamps can

Develop a desktop Chatbot application Project Description: Looking for an in depth and smart working chatbot Seeking someone with skills working with AI and chatbots and t

Why uploading a web page is important? Describe in 2 - 3 lines? Through only uploading webpage we could place our data so that another can reach up to what we have loaded. Uplo