Solved

multiple char primitive data type

Posted on 2016-08-09
6
26 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
6 Comments
 
LVL 15

Accepted Solution

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

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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 15

Expert Comment

by:gurpsbassi
ID: 41774467
Closed.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
count7 challenge 12 70
computer science syllabus 3 52
Java asynchronous logging 4 34
Strange loading of website behaviour 3 23
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
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:

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now