Skip to content

Commit 5e49671

Browse files
committed
Core JAVA
1 parent 8aa9bda commit 5e49671

File tree

9 files changed

+235
-1
lines changed

9 files changed

+235
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#.idea/
2+
#IdeaProjects.iml
3+
out/

.idea/.gitignore

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Core JAVA.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# Core JAVA
2+
3+
```java
4+
class test{
5+
public static void main(string[] args){
6+
7+
int x = 10;
8+
// System.out.println("Hello");
9+
}
10+
}
11+
```
12+
## How many identifiers are their?
13+
14+
- Test
15+
- main
16+
- string
17+
- args
18+
- x
19+
20+
---
21+
22+
## valid identifiers
23+
24+
- ✅ total_numbers
25+
- ❌ total#
26+
- ❌ 123total
27+
- ✅ total123
28+
- ✅ ca$h
29+
-`_$_$_$_$_`
30+
- ❌ all@hands
31+
- ✅ Java2Share
32+
- ✅ Integer
33+
- ✅ Int
34+
- ❌ int
35+
36+
---
37+
38+
### **Java Reserved Words (53)**
39+
40+
**1. Keywords (50)**
41+
42+
* **Used Keywords (48)**
43+
44+
* Examples:
45+
46+
```
47+
if, else, for, while, class, interface, static, public, private, protected, return, void, new, try, catch, finally, throw, throws, switch, case, break, continue, default, do, enum, extends, implements, import, package, synchronized, volatile, transient, abstract, final, native, strictfp, this, super, assert, byte, short, int, long, float, double, char, boolean
48+
```
49+
* **Unused Keywords (2)**
50+
51+
* `goto`
52+
* `const`
53+
54+
**2. Reserved Literals (3)**
55+
56+
* `true`
57+
* `false`
58+
* `null`
59+
60+
---
61+
62+
```java
63+
Reserved Words (53)
64+
65+
├── Keywords (50)
66+
│ │
67+
│ ├── Used Keywords (48)
68+
│ │ ├── if
69+
│ │ ├── else
70+
│ │ ├── for
71+
│ │ ├── while
72+
│ │ └── ... (other 44 keywords)
73+
│ │
74+
│ └── Unused Keywords (2)
75+
│ ├── goto
76+
│ └── const
77+
78+
└── Reserved Literals (3)
79+
├── true
80+
├── false
81+
└── null
82+
```
83+
84+
---
85+
86+
### **Java Reserved Words (53)**
87+
88+
```java
89+
Reserved Words (53)
90+
91+
├── Keywords (50)
92+
│ │
93+
│ ├── Data Types (8) ✅
94+
│ │ ├── byte
95+
│ │ ├── short
96+
│ │ ├── int
97+
│ │ ├── long
98+
│ │ ├── float
99+
│ │ ├── double
100+
│ │ ├── boolean
101+
│ │ └── char
102+
│ │
103+
│ ├── Flow Control (11) ✅
104+
│ │ ├── if
105+
│ │ ├── else
106+
│ │ ├── switch
107+
│ │ ├── case
108+
│ │ ├── default
109+
│ │ ├── while
110+
│ │ ├── do
111+
│ │ ├── for
112+
│ │ ├── break
113+
│ │ ├── continue
114+
│ │ └── return
115+
│ │
116+
│ ├── Modifiers (11) ✅
117+
│ │ ├── public
118+
│ │ ├── private
119+
│ │ ├── protected
120+
│ │ ├── static
121+
│ │ ├── final
122+
│ │ ├── abstract
123+
│ │ ├── synchronized
124+
│ │ ├── native
125+
│ │ ├── strictfp (added in Java 1.2)
126+
│ │ ├── transient
127+
│ │ └── volatile
128+
│ │
129+
│ ├── Exception Handling (6) ✅
130+
│ │ ├── try
131+
│ │ ├── catch
132+
│ │ ├── finally
133+
│ │ ├── throw
134+
│ │ ├── throws
135+
│ │ └── assert (added in Java 1.4)
136+
│ │
137+
│ ├── Class Related (6) ✅
138+
│ │ ├── class
139+
│ │ ├── interface
140+
│ │ ├── extends
141+
│ │ ├── implements
142+
│ │ ├── package
143+
│ │ └── import
144+
│ │
145+
│ ├── Object Related (4) ✅
146+
│ │ ├── new
147+
│ │ ├── instanceof
148+
│ │ ├── super
149+
│ │ └── this
150+
│ │
151+
│ └── Unused Keywords (2)
152+
│ ├── goto
153+
│ └── const
154+
155+
└── Reserved Literals (3)
156+
├── true
157+
├── false
158+
└── null
159+
```
160+
161+
---
162+

IdeaProjects.iml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" packagePrefix="com.akashdipmahapatra" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>

Practice/Q1.java

Lines changed: 0 additions & 1 deletion
This file was deleted.

Practice/Q1_DaysInMonth.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.akashdipmahapatra.Practice;
2+
3+
import java.util.Scanner;
4+
5+
public class Q1_DaysInMonth {
6+
public static void main(String[] args) {
7+
Scanner sc = new Scanner(System.in);
8+
9+
System.out.print("Enter date (dd-mm-yyyy): ");
10+
String input = sc.nextLine();
11+
12+
String[] parts = input.split("-");
13+
14+
int day = Integer.parseInt(parts[0]);
15+
int month = Integer.parseInt(parts[1]);
16+
int year = Integer.parseInt(parts[2]);
17+
18+
int daysInMonth;
19+
20+
if (month == 2)
21+
daysInMonth = 28;
22+
else if (month == 4 || month == 6 || month == 9 || month == 11)
23+
daysInMonth = 30;
24+
else
25+
daysInMonth = 31;
26+
27+
System.out.println("Output: " + daysInMonth);
28+
}
29+
}

0 commit comments

Comments
 (0)