Definitions [1]
Define abstraction.
Abstraction is a process of hiding the implementation details and showing only functionality to the user.
Important Questions [25]
- Define Abstraction.
- Differentiate Between If Else If and Switch-case Statements.
- Give the Output of the Following Code : String P = “20”, Q = “19”, Int a = Integer .Parselnt(P); Int B = Integer. Valueof(Q); System.Out.Println(A+””+B);
- State the Data Type and Value of Res After the Following is Executed : Char Ch = ‘9’; Res = Character. Isdigit(Ch)
- State the Number of Bytes Occupied by Char and Int Data Types.
- State the data type and value of res after the following is executed: char ch = ‘t’; res=Character. toUpperCase(ch);
- Write the Memory Capacity (Storage Size) of Short and Float Data Type in Bytes.
- Give the output of the following Character class method: Character.toUpperCase('a')
- Give the output of the following Character class method: Character.isLetterOrDigit('W')
- Write the value of n after execution: char ch = 'd'; int n = ch + 5;
- What is the method to check whether a character is a letter or digit?
- Write a difference between the functions isUpperCase() and toUpperCase().
- Int res = ‘A’; What is the value of res?
- Write the Return Data Type of the Following Function: Log( )
- Write a Program to Accept a Number and Check and Display Whether It is a Niven Number Or Not. (Niven Number is that Number Which is Divisible by Its Sum of Digits). Example: Consider the Number 126.
- State One Difference Between the Floating Point Literals Float and Double.
- What is the data type returned by the library function?compareTo()
- What will be the output when the following code segment is executed?String s = “1001”;int x = Integer. valueOf(s);double y = Double.valueOf(s);System.out.println(“x=”+x);System.out.println(“y=”+y);
- What will be the output when the following code segment is executed? System.out.println(“The king said\”Begin at the beginning!\“to me.”);
- Design a Class to Overload a Function Area( ) as Follows: (I) Double Area (Double A, Double B, Double C) with Three Double Arguments, Returns the Area of a Scalene Triangle Using the Formula:
- Predict the output of the follo1fing, .code snippet: String P = "20", Q = "22"; int a = Integer.parseint(P); int b = Integer.value0f(Q); System.out.println(a + " " + b);
- Name the wrapper class of char type.
- Classify the following as primitive or non-primitive data type: char
- Differentiate between boxing and unboxing.
- When an object of a Wrapper class is converted to its corresponding primitive data type, it is called as ______.
