Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

multiple char primitive data type

Posted on 2016-08-09
6
Medium Priority
?
34 Views
Last Modified: 2016-08-29
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
Comment
Question by:rgb192
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 16

Accepted Solution

by:
gurpsbassi earned 2000 total points (awarded by participants)
ID: 41749075
Array of chars is considered an object.
0
 
LVL 21

Expert Comment

by:Amitkumar Panchal
ID: 41749087
Agree with gupsbassi. Array is an object irrespective of what does it store (object or primitive).
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 41749166
I agree with Amitkumar Panchal who agrees with gurpsbassi.
1
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 
LVL 16

Expert Comment

by:krakatoa
ID: 41750180
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
 
LVL 10

Expert Comment

by:Jeffrey Dake
ID: 41751510
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
 
LVL 16

Expert Comment

by:gurpsbassi
ID: 41774467
Closed.
0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question