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
Explain java.lang.string library in java? Strings are objects. Specifically they're instances of the class java.lang.String . This class has several methods which are useful f

How do I write a java program that enters a six digit number and takes the sum of the six digits?

Benefits of AOP (Aspect Oriented programming) OOP can give the system level code like transaction management, logging, security etc to scatter throughout the business logic. A

write a program that counts the number of occurrences of the string in the n-th Padovan string P(n).   program in java // aakash , suraj , prem sasi kumar kamaraj college

Write a program to explain do while loop in Java ? // This is the Hello program in Java class Hello { public static void main (String args[]) { int i = -1; do { if (

Explain java flow control ? if else else if while for do while switch case break continue goto is a reserved word.

How do you start the Energy consumption program

Need to develop a Small Android App using Text to speech and Speech to Text feature. Project Description: When the Android App Opens, It will connect to Windows Azure cloud,

Include Photo Upload feature to Android App with Google App Engine Project Description: I have one small Android App skeleton that requires some features added to and backed

eAgro Portal Project: Technology Used: Java Server Faces, JSR 168 Specification, Websphere Portal Server5.0, DB2 database And Rational Application Developer, Jasper Report Too