Answers
1.Option D is correct.
rand.nextInt() % 81 + 20 is correct because Formula to find Random number with max and min value inclusive is ((max - min) + 1)+ min
In this max value is 100 and min value is 20 then( (100-20)+1) + 20=81 + 20.
2.Option D is correct.
file.close() is used to close the file. close() is a method of FileOutputStream class.
3. Option D is correct.
Character.isLowerCase(c) returns true if char c is a lower case english letter.This method takes a character value and returns boolean value true and false.If it returns boolean value true that means character is in lowercase otherwise it returns false.
4.Option A is correct.
There is a compile error.(Type mismatch : cannot convert int to char).
char c='A';
char x = c + 32; // cannot convert int to char.32 is not convert to character.
System.out.println(x);