-
Notifications
You must be signed in to change notification settings - Fork 0
/
bs.java
20 lines (19 loc) · 1.06 KB
/
bs.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.util.*;
class bs {
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
// String str = sc.nextLine();
// System.out.println(str.toUpperCase());
// String s1 = "Hello";
// String s2 = "World";
// String s3 = s1.concat(s2); // to concatenate two strings
// int len = s1.length() // to get the length of the string
//how string is stored in a memory , a univeraL mapping of nos is used called ASCII values(American Standard code International INdexes , it can store upto 255 chars , a--> 97 , b--> 98 , c-->99 ..... z-->122 ;; A-->65 ,B-->66 , C--> 67 ... Z--> 90 ;; '0'(string 0) --> 48 , '1' --> 49 ,'2'--> 50 , ..'10' -- 10 is not a character , its a string as it is a combination of two diff chars
String s = "abcdefghijklmnopqrstuvwxyz"; // can visaulaizoe a string as a array of these chars
for(int i = 0 ;i <s.length() ;i++ ){
System.out.print((int)(s.charAt(i)) + " ");
System.out.print((s.charAt(i)) + " ");
}
}
}