Friday, August 24, 2018

Java Programming Interview Questions

| Friday, August 24, 2018
Part 7

31 : What is default value of local variable.
Answer : There is non whatsoever default value of local variable. You must accept to initialize it. View more details on local variables inwards java.

32 : Java back upwards constructor inheritance?
Answer : No, Constructor inheritance is non supported inwards java. View more details on constructor inwards java.

33 : Which is super shape of all other classes inwards java?
Answer : java.lang.Object is  super shape of all other classes inwards java.

34 : What is Encapsulation?
Answer : Encapsulation is procedure of packing code together with information together In to a unmarried Unit. View more details on Encapsulation in java.

35 : Write a plan to opposite a string without using opposite function.
Answer : Program to opposite a string without using opposite business office inwards coffee is every bit bellow.

package JAVAExamples;  populace shape StringReverse {  populace static void main(String[] args) {     //String to reverse.   String str = "This Is String.";   String revstring = "";    for (int i = str.length() - 1; i >= 0; --i) {    //Start getting characters from terminate of the string.    revstring += str.charAt(i);   }    System.out.println(revstring);  } }

Output : .gnirtS sI sihT

Related Posts