GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing www.w3schools.com — Practice Java Coding Problems
❮
❯
Java TutorialJava HOME Java Intro Java Get Started Java Syntax Java Output Java Comments Java Variables
Variables
Print Variables
Multiple Variables
Identifiers
Constants (Final)
Real-Life Examples
Code Challenge
Java Data Types
Data Types
Numbers
Booleans
Characters
Real-Life Example
Non-primitive Types
The var Keyword
Code Challenge
Java Type Casting
Java Operators
Java Strings
Java Math
Java Booleans
Java If...Else
Java Switch
Java While Loop
Java For Loop
Java Break/Continue
Java Arrays
Java MethodsJava Methods Java Method Challenge Java Method Parameters Java Method Overloading Java Scope Java RecursionJava ClassesJava OOP Java Classes/Objects Java Class Attributes Java Class Methods Java Class Challenge Java Constructors Java this Keyword Java Modifiers Java Encapsulation Java Packages / API Java Inheritance Java Polymorphism Java super Keyword Java Inner Classes Java Abstraction Java Interface Java Anonymous Java OOP Visuals Java Enum Java User Input Java DateJava ErrorsJava Errors Java Debugging Java Exceptions Java Multiple Exceptions Java try-with-resourcesJava Problem SolvingJava Problem Solving Java Build the Logic Java Test CasesJava ProjectsJava ProjectsJava File HandlingJava Files Java Create Files Java Write Files Java Read Files Java Delete FilesJava I/O StreamsJava I/O Streams Java FileInputStream Java FileOutputStream Java BufferedReader Java BufferedWriterJava Data StructuresJava Data Structures Java Collections Java List Java ArrayList Java LinkedList Java List Sorting Java Set Java HashSet Java TreeSet Java LinkedHashSet Java Map Java HashMap Java TreeMap Java LinkedHashMap Java Iterator Java AlgorithmsJava AdvancedJava Wrapper Classes Java Generics Java Annotations Java RegEx Java Threads Java Lambda Java Optional Java Advanced SortingJava CertJava CertificateJava How To'sJava How Tos
How Tos
Add Two Numbers
Swap Two Variables
Even or Odd Number
Reverse a Number
Positive or Negative
Square Root
Area of Rectangle
Celsius to Fahrenheit
Sum of Digits
Check Armstrong Num
Random Number
Count Words
Count Vowels in a String
Remove Vowels
Count Digits in a String
Reverse a String
Palindrome Check
Check Anagram
Convert String to Array
Remove Whitespace
Count Character Frequency
Sum of Array Elements
Find Array Average
Sort an Array
Find Smallest Element
Find Largest Element
Second Largest Array
Min and Max Array
Merge Two Arrays
Remove Duplicates
Find Duplicates
Shuffle an Array
Factorial of a Number
Fibonacci Sequence
Find GCD
Check Prime Number
ArrayList Loop
HashMap Loop
Loop Through an Enum
Java ExamplesJava Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Practice Problems Java Server Java Syllabus Java Study Plan Java Interview Q&AJava ReferenceJava Reference Java Keywords
assert
abstract
boolean
break
byte
case
catch
char
class
continue
const
default
do
double
else
enum
exports
extends
final
finally
float
for
goto
if
implements
import
instanceof
int
interface
long
module
native
new
package
private
protected
public
return
requires
short
static
strictfp
super
switch
synchronized
this
throw
throws
transient
try
var
void
volatile
while
ArrayList Methods
add()
addAll()
clear()
clone()
contains
ensureCapacity()
forEach()
get()
indexOf()
isEmpty()
iterator()
lastIndexOf()
listIterator()
remove()
removeAll()
removeIf()
replaceAll()
retainAll()
set()
size()
sort()
spliterator()
subList()
toArray()
trimToSize()
Arrays Methods
BufferedReader
BufferedWriter
Character Methods
compare()
getNumericValue()
isAlphabetic()
isDigit()
isLetter()
isLetterOrDigit()
isLowerCase()
isUpperCase()
isWhitespace()
toLowerCase()
toString()
toUpperCase()
valueOf()
Collections Methods
sort()
binarySearch()
reverse()
reverseOrder()
shuffle()
swap()
frequency()
max()
min()
disjoint()
copy()
fill()
replaceAll()
unmodifiableList()
unmodifiableSet()
unmodifiableMap()
Comparator Methods
compare()
comparing()
comparingInt()
naturalOrder()
reversed()
reverseOrder()
thenComparing()
compareTo()
Date and Time
now()
of()
parse()
getYear()
getMonthValue()
getMonth()
getDayOfMonth()
getDayOfWeek()
plusDays()
minusDays()
plusMonths()
plusYears()
isBefore()
isAfter()
isLeapYear()
lengthOfMonth()
format()
now()
of()
getHour()
getMinute()
plusHours()
plusMinutes()
now()
of()
toLocalDate()
toLocalTime()
format()
ofPattern()
format()
Enum Methods
Errors & Exceptions
ArithmeticException
ArrayIndexOutOfBoundsException
ClassFormatError
ClassNotFoundException
ConcurrentModificationException
FileNotFoundException
IncompatibleClassChangeError
InputMismatchException
InterruptedException
InvalidClassException
IOException
NegativeArraySizeException
NoClassDefFoundError
NoSuchFieldException
NoSuchMethodException
NullPointerException
NumberFormatException
RuntimeException
StringIndexOutOfBoundsException
TypeNotPresentException
IllegalArgumentException
IllegalStateException
File Methods
createNewFile()
delete()
exists()
canRead()
canWrite()
isFile()
isDirectory()
length()
getName()
getAbsolutePath()
getPath()
getParent()
list()
listFiles()
mkdir()
mkdirs()
renameTo()
setReadOnly()
setWritable()
setReadable()
setExecutable()
canExecute()
FileInputStream
FileOutputStream
FileReader
FileWriter
HashMap Methods
clear()
clone()
compute()
computeIfAbsent()
computeIfPresent()
containsKey()
containsValue()
entrySet()
forEach()
get()
getOrDefault()
isEmpty()
keySet()
merge()
put()
putAll()
putIfAbsent()
remove()
replace()
replaceAll()
size()
values()
HashSet Methods
add()
addAll()
clear()
clone()
contains()
isEmpty()
iterator()
remove()
removeAll()
size()
spliterator()
toArray()
Integer Methods
compare()
compareTo()
equals()
intValue()
max()
min()
parseInt()
sum()
toBinaryString()
toHexString()
toOctalString()
toString()
valueOf()
MAX_VALUE
MIN_VALUE
Iterator Methods
LinkedHashMap Methods
clear()
clone()
compute()
computeIfAbsent()
computeIfPresent()
containsKey()
containsValue()
entrySet()
forEach()
get()
getOrDefault()
isEmpty()
keySet()
merge()
put()
putAll()
putIfAbsent()
remove()
replace()
replaceAll()
size()
values()
LinkedHashSet Methods
add()
addAll()
clear()
clone()
contains()
isEmpty()
iterator()
remove()
removeAll()
size()
spliterator()
toArray()
LinkedList Methods
add()
addAll()
addFirst()
addLast()
clear()
clone()
contains
descendingIterator()
element()
forEach()
get()
getFirst()
getLast()
indexOf()
isEmpty()
iterator()
lastIndexOf()
listIterator()
offer()
offerFirst()
offerLast()
peek()
peekFirst()
peekLast()
poll()
pollFirst()
pollLast()
pop()
push()
remove()
removeAll()
removeFirst()
removeFirstOccurrence()
removeIf()
removeLast()
removeLastOccurrence()
replaceAll()
retainAll()
set()
size()
sort()
spliterator()
subList()
toArray()
Math Methods
abs()
acos()
addExact()
asin()
atan()
atan2()
cbrt()
ceil()
copySign()
cos()
cosh()
decrementExact()
exp()
expm1()
floor()
floorDiv()
floorMod()
getExponent()
hypot()
IEEEremainder()
incrementExact()
log()
log10()
log1p()
max()
min()
multiplyExact()
negateExact()
nextAfter()
nextDown()
nextUp()
pow()
random()
rint()
round()
scalb()
signum()
sin()
sinh()
sqrt()
subtractExact()
tan()
tanh()
toDegrees()
toIntExact()
toRadians()
ulp()
Optional Methods
empty()
filter()
flatMap()
get()
ifPresent()
isPresent()
map()
of()
ofNullable()
orElse()
orElseGet()
orElseThrow()
Output Methods
Random Methods
RegEx Methods
compile()
flags()
matcher()
matches()
pattern()
quote()
split()
end()
find()
group()
groupCount()
lookingAt()
matches()
replaceAll()
replaceFirst()
reset()
start()
Scanner Methods
close()
delimiter()
findInLine()
findWithinHorizon()
hasNext()
hasNextBoolean()
hasNextByte()
hasNextDouble()
hasNextFloat()
hasNextInt()
hasNextLine()
hasNextLong()
hasNextShort()
locale()
next()
nextBoolean()
nextByte()
nextDouble()
nextFloat()
nextInt()
nextLine()
nextLong()
nextShort()
radix()
reset()
useDelimiter()
useLocale()
useRadix()
String Methods
charAt()
codePointAt()
codePointBefore()
codePointCount()
compareTo()
compareToIgnoreCase()
concat()
contains()
contentEquals()
copyValueOf()
endsWith()
equals()
equalsIgnoreCase()
format()
getBytes()
getChars()
hashCode()
indexOf()
intern()
isEmpty()
join()
lastIndexOf()
length()
matches()
offsetByCodePoints()
regionMatches()
replace()
replaceAll()
replaceFirst()
split()
startsWith()
subSequence()
substring()
toCharArray()
toLowerCase()
toString()
toUpperCase()
trim()
valueOf()
StringBuilder Methods
append()
appendCodePoint()
capacity()
charAt()
codePointAt()
codePointBefore()
codePointCount()
delete()
deleteCharAt()
ensureCapacity()
getChars()
indexOf()
insert()
lastIndexOf()
length()
offsetByCodePoints()
replace()
reverse()
setCharAt()
setLength()
subSequence()
substring()
toString()
trimToSize()
System Methods
currentTimeMillis()
nanoTime()
exit()
gc()
getProperty()
getProperties()
setProperty()
clearProperty()
arraycopy()
identityHashCode()
lineSeparator()
getenv()
in
out
err
Thread Methods
currentThread()
getName()
getPriority()
interrupt()
isAlive()
isInterrupted()
join()
run()
setName()
setPriority()
sleep()
start()
TreeMap Methods
firstKey()
lastKey()
firstEntry()
lastEntry()
floorKey()
ceilingKey()
lowerKey()
higherKey()
headMap()
tailMap()
subMap()
pollFirstEntry()
pollLastEntry()
descendingMap()
clear()
clone()
compute()
computeIfAbsent()
computeIfPresent()
containsKey()
containsValue()
entrySet()
forEach()
get()
getOrDefault()
isEmpty()
keySet()
merge()
put()
putAll()
putIfAbsent()
remove()
replace()
replaceAll()
size()
values()
TreeSet Methods
first()
last()
floor()
ceiling()
lower()
higher()
headSet()
tailSet()
subSet()
pollFirst()
pollLast()
descendingSet()
add()
addAll()
clear()
clone()
contains()
isEmpty()
iterator()
remove()
removeAll()
size()
spliterator()
toArray()
Practice Java Coding Problems
Share
Improve your skills by solving real Java coding problems. Write code, submit, and get instant feedback. Weekly Problem
Count a CharacterCount how often one character appears in a word.
Easy
20 XP
main.py
Subscribe to Weekly Practice ProblemGet the latest coding practice problem delivered to your inbox every week. More Practice Problems
Sign in to access all Practice Problems and track your progress. Sign InPast Weekly Challenges
How it WorksEach challenge gives you starter code in Java. Your program reads input and prints the correct output. When you submit, your code is tested against multiple hidden test cases with different inputs. Your score is based on how many tests pass. Partial credit is given for partially correct solutions. Free account Track your progress
XP earned 0
Day streak 0
Spaces 0
League —
New Learn in Adventure Mode W3Schools Adventure AppCoding fundamentals as bite-sized lessons and challenges.
×
Contact SalesIf you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: Report ErrorIf you want to report an error, or if you want to make a suggestion, send us an e-mail: Top TutorialsHTML TutorialCSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial Top ReferencesHTML ReferenceCSS Reference JavaScript Reference SQL Reference Python Reference W3.CSS Reference Bootstrap Reference PHP Reference HTML Colors Java Reference AngularJS Reference jQuery Reference
W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy. Copyright 1999-2026 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |