Computer Applications
Name the type of type casting in the given statements:
(a) double m = 'b';
(b) char ch = (char)68;
Related Questions
Give the output of the following program segment:
for(k=a;k<=a*b;k+=a) { if (k%b==0) break; } System.out.println(k);Give the output when a = 6, b = 4.
Kamal wants to display only the alphabets stored in a character array. While compiling the code, an error was displayed. Check for the statement with the error and write the correct statement.
char arr[]={'4', '&', 'a', 'w', 'd'}; int i; for(i=0;i<arr.length;i++) { if(Character.isLetter(arr)) System.out.println(arr); }Write Java statements for the following:
(a) To assign the cube root of -343 to a variable with the appropriate datatype.
(b) To assign the position of the last occurrence of @ in the String s with the appropriate datatype.Mention the output of this code snippet:
int lives = 5; System.out.println(lives--); System.out.println(lives);