🌐
W3Schools
w3schools.com › JAVA › ref_string_charat.asp
Java String charAt() Method
Java Examples Java Videos Java ... Java Study Plan Java Interview Q&A ... The charAt() method returns the character at the specified index in a string....
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-string-charat-method-example
Java String charAt() Method - GeeksforGeeks
June 1, 2026 - class Geeks { public static void main(String args[]) { // Define a string String s = "Java String charAt() example"; // Retrieve and print the character at index 8 char ch = s.charAt(8); System.out.println(ch); // Retrieve and print the character at index 24 ch = s.charAt(24); System.out.println(ch); } }
Discussions

How is String charAt implemented in Java?
if you go to line 111 you'll see that the inside of a String is a char[] already More on reddit.com
🌐 r/learnprogramming
8
1
August 30, 2021
Char and scanner error
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/javahelp
3
1
October 7, 2023
Char .equals() method
char and all primitive types (int, boolean, etc.) are not objects, and thus do not have methods attached to them. If you want to compare the values of primitive types, just use double equals (==). The exception to this is a concept called "autoboxing" and "unboxing", which include the object forms of primitives (Character, Integer, Boolean, etc.), in which you can call methods such as equals(), toString(), and so forth. Unless you really have to, like with specifying generic types or supporting null, you'll use a primitive type instead of its boxed form. Here's some more reading if you like. More on reddit.com
🌐 r/javahelp
8
3
January 15, 2023
How do you count the number characters in a portion of a string?
You have the overall length of the string. You have the position of the decimal point. This is all you need. A little bit of mathematics will do the rest. Think about it: 123.4567 The overall length is 8 characters. The position of the decimal point is 3 (positions are 0-based) - it is the 4th character in the string. How many characters are before the decimal point? How many characters are after? (the length and the position of the decimal point are all you need to calculate the characters) Edit: if you are not allowed to use .indexOf, you could loop over the whole string, character by character (.charAt) and compare and count. If you reach the decimal point, you have the number of digits before the decimal point, and then either keep looping and count again (with the counter reset before restarting the count) to get the number of digits after, or, you calculate (again with the length). More on reddit.com
🌐 r/learnjava
6
0
September 5, 2022
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › String.html
String (Java Platform SE 8 )
July 21, 2026 - Java™ Platform Standard Ed. 8 ... The String class represents character strings.
🌐
CodeGym
codegym.cc › java blog › strings in java › java string charat()
Java String charAt()
February 20, 2025 - public char charAt(int index) Parameters The charAt() method receives a positive integer because the length is never below 0. Returns It always returns a char value of the specified index but if parameter value is negative or above the length ...
🌐
TechVidvan
techvidvan.com › tutorials › java-string-charat-method
Java String charAt() Method - TechVidvan
February 3, 2025 - The Java String returns the character in a string at the given position charAt(int index) function.
🌐
Scaler
scaler.com › home › topics › java string charat() method
Java String charAt() Method - Scaler Topics
April 21, 2024 - The method charAt() in Java can be defined as the inbuilt method that returns the character value at the stated index number when searched in a string. Learn more on Scaler Topics.
🌐
freeCodeCamp
freecodecamp.org › news › charat-in-java-how-to-use-the-java-charat-method-2
charAt() in Java – How to Use the Java charAt() Method
March 31, 2022 - The charAt() method in Java returns the char value of a character in a string at a given or specified index.
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › charAt
String.prototype.charAt() - JavaScript | MDN
The charAt() method of String values returns a new string consisting of the single UTF-16 code unit at the given index.
🌐
Codecademy
codecademy.com › docs › java › strings › .charat()
Java | Strings | .charAt() | Codecademy
May 29, 2025 - In Java, the .charAt() method returns the character at a specified index in a string.
🌐
Tutorialspoint
tutorialspoint.com › java › lang › string_charat.htm
Java - String charAt() Method
The Java String charAt() method is used to retrieve the character at the specified index. The indexes refer to the character position in the sequence. The first char value represents the 0th index, and the next char value represents the 1st ...
🌐
Vultr Docs
docs.vultr.com › java › standard library › java › lang › string › charat()
Java String charAt() - Get Character At Index
November 19, 2024 - The charAt() method in Java is a straightforward yet essential function of the String class, used to retrieve a character at a specific index from a given string.
🌐
W3Schools
w3schools.com › java › java_ref_string.asp
Java String Reference
assert abstract boolean break byte case catch char class continue default do double else enum exports extends final finally float for if implements import instanceof int interface long module native new package private protected public return requires short static super switch synchronized this throw throws transient try var void volatile while Java String Methods · charAt() codePointAt() codePointBefore() codePointCount() compareTo() compareToIgnoreCase() concat() contains() contentEquals() copyValueOf() endsWith() equals() equalsIgnoreCase() format() getBytes() getChars() hashCode() indexOf() isEmpty() join() lastIndexOf() length() matches() offsetByCodePoints() regionMatches() replace() replaceAll() replaceFirst() split() startsWith() subSequence() substring() toCharArray() toLowerCase() toString() toUpperCase() trim() valueOf() Java Math Methods ·
🌐
W3Resource
w3resource.com › java-tutorial › string › string_charat.php
Java String charAt() Method - w3resource
Java String charAt() Method: Returns the character value at the specified index.
🌐
Dinesh on Java
dineshonjava.com › home › java – string charat() method
Java - String charAt() Method - Dinesh on Java
September 16, 2017 - Description: This method returns the character located at the String’s specified index. The string indexes start from zero. Syntax: Here is the syntax of this method: public char charAt(int index) Parameters: Here is the detail of parameters: index — Index of the character to be returned.
🌐
PREP INSTA
prepinsta.com › home › java tutorial › java string charat() method
Java String charAt() Method | PrepInsta
June 7, 2023 - The charAt() method in Java is a method of the String class and is used to retrieve the character at a specified index in a string.
🌐
Udemy
blog.udemy.com › home › it & development › software development › java charat() – the method, its uses, and its implications
Java charAt() - The Method, its Uses, and its Implications - Udemy Blog
April 14, 2026 - Java `charAt()` is a built-in String method that returns the character at a specified index. This article covers its syntax, zero-indexing rules, practical code examples, and how to combine it with other String methods.
🌐
Quora
hdhzuihwqnkfzjmy.quora.com › charAt
charAt - JAVA String Methods - Quora
> [code]public char charAt(int index) [/code] * used to find the char value at the mentioned index. * The index value provided to this method must be in range of 0 and length-of-string - 1. * If the specified index is -ve or exceeds the length of string, the method will throws IndexOutOfBound...
🌐
GeeksforGeeks
geeksforgeeks.org › java › strings-in-java
Java Strings - GeeksforGeeks
Using the new keyword creates a new object in heap memory, even if the same string already exists in the pool. ... The CharSequence interface represents a sequence of characters in Java. It provides common methods such as length(), charAt(), subSequence(), and toString() for working with character sequences.
Published: 2 weeks ago
🌐
w3resource
w3resource.com.cach3.com › java-tutorial › string › string_charat.php.html
Java String: charAt Method - w3resource
May 28, 2022 - Java String charAt Method: Returns the char value at the specified index.