Professional Documents
Culture Documents
Unit – III [Choose appropriate option for the following statements ] 5x1=5
1. A package contains:
1. tags
2. classes
3. data
4. arrays
1. block
2. object
3. wrapper class
4. none
1.What is a package?
4. Differentiate between:
1. Float.parseFloat()
2. Double.toString()
3. Integer.valueOf()
4. Character.isDigit()
5. Character.isWhitespace()
Unit – V [ Find the output of the following program snippets] any 6 6x1=6
1.char ch = '*';
boolean b = Character.isLetter(ch);
System.out.println(b);
2.char c = 'A';
int n = (int) c + 32;
System.out.println((char)n);
3.String s= "7";
int t =Integer.parseInt(s);
t=t+1000;
System.out.println(t);
4.char c = 'B';
int i = 4;
System.out.println(c+i);
System.out.println((int)c+i);
5.char ch = 'y';
char chr = Character.toUpperCase(ch);
int p = (int) chr;
System.out.println(chr + "\t" + p);
6.int n = 97;
char ch = Character.toUpperCase((char)n);
System.out.println(ch + " Great Victory");
8.char ch = 'A';
char chr = Character.toLowerCase(ch);
int n = (int)chr-32;
System.out.println((char)n + "\t" + chr);
1. Write a program in Java to input a character. Find and display the next 10th character in
the ASCII table.
2. Write a program in Java to input a character. Display next 5 characters.
3. Write a program in Java to generate all the alternate letters in the range of letters from A
to Z.
4. Write a program to input a set of 20 letters. Convert each letter into upper case. Find and
display the number of vowels and number of consonants present in the set of given
letters.
5. Write a program in Java to accept an integer number N such that 0<N<27. Display the
corresponding letter of the alphabet (i.e. the letter at position N).
[Hint: If N =1 then display A]