Skip to content
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading.
Please reload this page
.
Cheatsheet-lang
/
Java
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
main
Breadcrumbs
Java
/
LocalVariables.java
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
24 lines (18 loc) · 451 Bytes
main
Breadcrumbs
Java
/
LocalVariables.java
Copy path
Top
File metadata and controls
Code
Blame
24 lines (18 loc) · 451 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.*;
public class LocalVariables {
public void sum() {
// Local variable to sum function
int x = 25;
int y = 35;
int z = x + y;
System.out.println("Sum: " + z);
}
public static void main(String[] args) {
// Local variables
int a = 10;
int b = 20;
int c = a + b;
// Print the sum of a and b
System.out.println("Sum: " + c);
}
}
You can’t perform that action at this time.