Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 38
  • Last Modified:

multiple char primitive data type

char is primitive


string="hello";
char[6]='h','e'','l','l'l','o'

is multiple char primitive or an object

could an object be primitive?
0
rgb192
Asked:
rgb192
1 Solution
 
gurpsbassiCommented:
Array of chars is considered an object.
0
 
Amitkumar PSr. ConsultantCommented:
Agree with gupsbassi. Array is an object irrespective of what does it store (object or primitive).
0
 
krakatoaCommented:
I agree with Amitkumar Panchal who agrees with gurpsbassi.
1
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
krakatoaCommented:
char[6]='h','e'','l','l'l','o'

You can't do that anyway, it wouldn't compile as you have not allocated it to any variable - just in the same way you couldn't say : char = 'b';
0
 
Jeffrey Dake Senior Director of TechnologyCommented:
No by definition a primitive value is not an object.   Primitives are simple data types like int, char, double. The example you have above is a String which is actually an object. Java just translates the "hello" into a string object for you.
0
 
gurpsbassiCommented:
Closed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now