Java Online Compiler & Playground
HTML/CSS/JavaScript
HTML
CSS
Javascript
C++
C
PHP
Java
Python
Swift
C#
Ruby
Node.JS
Kotlin
jQuery
Go
R
TypeScript
Rozpocznij kurs Java
Zarejestruj się
password validation checker giving null pointer exception please help
0
Autor: ankit
Ciemny
Publiczny
Zapisz
JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public
class
Program
{
String pass
;
protected
int
length
(
String pass
){
int
x
=
pass
.
length
();
int
count
=
0
;
for
(
int
i
=
0
;
i
<=
pass
.
length
();
i
++){
char
ch
=
pass
.
charAt
(
i
)
;
if
(
ch
==
' '
){
count
++;
}
}
x
=
x
-
count
;
Enter to Rename, Shift+Enter to Preview
OUTPUT