Interview Questions and Answers Q781. What is GIT Stash ? Git
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q782. What is the use of NgControl ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q783. What is the use of Renderer class in angular ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q784. What is the use of ElementRef in angular ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q785. What is systemd in Unix ? Unix
This question was recently asked at 'Broadcom, Symantec'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 2 Companies Q786. What would you use the span element for ? HTML
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q787. When String literals are compared using ==, they always returns true if the string values are same because .. Reference Core Java
a. of overridden compareTo method b. of overridden compare method c. of String Pool d. == means that the object contents are equalAns.c. of String Pool
Q788. Which of the following is true ? Core Java
a. Composition is Tightly Bound b. Inheritance is Tightly Bound c. Object can only hold reference of only one other object d. A Class cannot be extended by multiple classesAns.b. Inheritance is Tightly Bound
a. x==y on all literals always returns false b. x.equals(y) on all literals always returns false c. if x.equals(y) returns true, x==y returns true too d. if x.equals(y) returns false, x==y returns trueAns.c. if x.equals(y) returns true, x==y returns true too
a. Constructor without parameters declared by user b. Constructor provided by Java if no constructor is declared c. Constructor with empty body d. All of the aboveAns.b. Constructor provided by Java if no constructor is declared
Q791. How can we create objects if we make the constructor private ? Core Java
a. We can't create objects if constructor is private b. We can only create objects if we follow singleton pattern c. We can only create one object d. We can create new object through static method or static blockAns.d. We can create new object through static method or static block
Q792. What will be the output of following ?
String str1 = new String("String1");
String str2 = new String("String1");
System.out.print(str1 == str2);
System.out.print(str1.equals(str2));
str1 = str2;
System.out.print(str1 == str2); Core Java
a. falsetruetrue b. truetruetrue c. truetruefalse d. falsetruefalseAns.a. falsetruetrue
Q793. What will be the output of following code ?
String str1 = "String1";
String str2 = "String1";
System.out.print(str1 == str2);
System.out.print(str1.equals(str2));
str1 = str2;
System.out.print(str1 == str2); Core Java
a. falsetruetrue b. falsefalsetrue c. truetruetrue d. falsefalsefalseAns.c. truetruetrue
Q794. What will be the output of following code ?
String str1 = "String1";
String str2 = "String2";
str1.concat("String3");
System.out.print(str1);
System.out.print(str2);
Core Java
a. String1String2 b. String1String3String3 c. String1String3String1String3 d. String1String1Ans.a. String1String2
Q795. What will be the output of following code ?
String str1 = "String1";
String str2 = "String2";
str1=str1.concat("String3");
System.out.print(str1);
System.out.print(str2); Core Java
a. String1String2 b. String1String3String2 c. String1String2String3 d. String1Stringg3String1Ans.b. String1String3String2
Q796. Which method needs to be implemented if a class is implementing comparable interface ? Core Java
a. comp b. compare c. compareTo d. compareEqualsAns.c. compareTo
Q797. Which of the following is false ? Core Java
a. A Class cannot override both hashcode and equals method. b. A class can override both hashcode and equals method. c. A Class must override hashCode method if its overridding equal method. d. A Class can override hashCode even if its not overridding equals method.Ans.a. A Class cannot override both hashcode and equals method.
a. interface b. abstract class c. final class d. util classAns.d. util class
Q799. Which of the following can throw ClassCastException ? Core Java
a. UpCasting b. DownCasting c. Casting to incompatible data type d. Casting to StringsAns.b. DownCasting
a. final instance methods b. final static methods c. non final instance methods d. non final static methodsAns.c. non final instance methods
Q801. x instanceOf y returns false .. Core Java
a. if x is an instance of y class b. if x is an instance of class implementing y interface c. if x is an instance of class extending y class d. if x is an instance of Class which is a parent of Y classAns.d. if x is an instance of Class which is a parent of Y class
a. java.lang.Object b. java.lang.Thread c. java.lang.Runnable d. java.lang.ImplementAns.a. java.lang.Object
Q803. if classes B and C extends Class A, Which of the following initialization is correct ? Core Java
a. B b = new C(); b. C c = new B(); c. B b = new A(); d. A a = new B();Ans.d. A a = new B();
Q804. If X implements Y and Y extends Z, Which of the following initialization is correct ? Core Java
a. X x = new Y(); b. X x = new Z(); c. Z z = new Y(); d. Z z = new X();Ans.d. Z z = new X();
Q805. If class A implements X interface, and Class B implements Y interface, and X is the parent of Y, Which of the following initialization is correct ? Core Java
a. A a = new B(); b. Y y = new A(); c. X x = new B(); d. Y y = new A();Ans.c. X x = new B();
Q806. What will be the output of executing following class ?
public class BuggyBread {
static {
System.out.println("Static Block");
}
{
System.out.println("Initialization Block");
}
BuggyBread(){
System.out.println("Constructor");
}
public static void main(String[] args){
System.out.println("Main Method");
}
}
Core Java
a. Static Block
Main Method b. Static Block
Instance Initialization Block
Main Method c. Static Block
Constructor
Main Method d. Static Block
Instance Initialization Block
Constructor
Main MethodAns.a. Static Block
Main Method
Q807. What will be the output upon executing following class ?
public class BuggyBread {
static {
System.out.println("Static Block");
}
{
System.out.println("Instance Initialization Block");
}
BuggyBread(){
System.out.println("Constructor");
}
public static void main(String[] args){
System.out.println("Main Method");
new BuggyBread();
}
} Core Java
a. Instance Initialization Block
Constructor
Static Block
Main Method b. Static Block
Instance Initialization Block
Constructor
Main Method c. Main Method
Static Block
Instance Initialization Block
Constructor d. Static Block
Main Method
Instance Initialization Block
ConstructorAns.d. Static Block
Main Method
Instance Initialization Block
Constructor
Q808. With the following code, Which is a valid way to initialize ?
public class BuggyBread {
private String element1;
private String element2;
private BuggyBread(String element1, String element2){
this.element1 = element1;
this.element2 = element2;
}
public static class Builder {
private String element1;
private String element2;
Builder(BuggyBread buggybread){
element1 = buggybread.element1;
element2 = buggybread.element2;
}
Builder withElement1(String element1){
this.element1 = element1;
return this;
}
Builder withElement2(String element2){
this.element2 = element2;
return this;
}
BuggyBread build(){
BuggyBread buggybread = new BuggyBread(element1,element2);
return buggybread;
}
}
} Core Java
a. BuggyBread buggybread = new BuggyBread(); b. BuggyBread buggybread = new BuggyBread("element1","element2"); c. BuggyBread.Builder builder = new BuggyBread.Builder(); d. BuggyBread.Builder builder = new BuggyBread.Builder("element1","element2");Ans.d. BuggyBread.Builder builder = new BuggyBread.Builder("element1","element2");
Q809. What will be the output of following code ?
public class BuggyBread {
private int x;
private int y;
BuggyBread(int x,int y){};
public static void main(String[] args){
BuggyBread buggybread = new BuggyBread();
System.out.println(buggybread.x);
}
} Reference Core Java
a. 0 b. null c. compilation error due to uninitialized element d. compilation error due to constructorAns.d. compilation error due to constructor
Q810. What will be the output of following ?
public class BuggyBread {
private int x;
private Integer y;
BuggyBread(int x,int y){};
public static void main(String[] args){
BuggyBread buggybread = new BuggyBread(1,2);
System.out.println(buggybread.x);
System.out.println(buggybread.y);
}
} Reference Core Java
a. 0 0 b. 0 null c. null 0 d. null nullAns.b. 0 null