Solved

multiple char primitive data type

Posted on 2016-08-09
6
28 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 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exception after setting jdbc session management 2 52
rhino JavaScript import, load 25 69
factorial example 4 35
servlet example 17 12
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 functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.

863 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

24 Experts available now in Live!

Get 1:1 Help Now