Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 11th, 2006, 11:00 PM
Authorized User
Join Date: Sep 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default char[...] or string.charAt(...)

Dear viewers,

I was wondering which was more efficient to use to view a particular character.... char[...] or string.charAt(...). <Just for viewing purposes>

Also, generally speaking, would it be more efficient to use char[] if modifying of individal characters is invovled and Strings if the number of characters changes drastically ?

Ibn Aziz
Old June 14th, 2006, 07:08 PM
Authorized User
Join Date: Jun 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts

I will take a crack at this and say the chatAt() method would be more efficient , Since the char[] thig would convert the whole string to a char array but the charAt() method would make the item u want in particular to a character . So i guess the charAt() method would be more efficient

Similar Threads
Thread Thread Starter Forum Replies Last Post
getting the last CHAR of a string kondapally Crystal Reports 0 December 13th, 2004 03:39 PM
Find the frequency of a char(s) in a string jdang67 SQL Language 8 October 14th, 2004 02:47 AM
Char in VC and String in VB ??? tranhung Visual C++ 1 February 16th, 2004 03:19 PM
Replace or remove the last char from the string sabu21s XSLT 12 January 8th, 2004 05:26 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.