What isan abstract class and when do you use it?
An abstract class allows you to create functionality that subclasses can implement or override. An interface only allows you to define functionality, not implement it. And whereas a class can extend only one abstract class, it can take advantage of multiple interfaces.
Is This Answer Correct ? | 0 Yes | 0 No |
If I will write String s=new String("XYZ"); String s1=new String("XYZ"); if(s.equals(s1)){ sop("True"); } else{ sop("False"); } This program will give me "True". But When I am creating my own class suppose class Employee{ public Employee(String name); } Employee e= new Employee("XYZ"); Employee e1 = neew Employee("XYZ"); if(e.equals(e1)){ sop("True"); } else{ sop("False"); } Then it will give the output as "False". Can I know what is happening internally?
What is a package?
What language is java written?
What is the purpose of garbage collection in java?
What are different types of states exist for a thread?
How does serialization work
why the constructor should be used in class,if there is no constructor what will happen?
When you say String is immutable, what do you mean by that? Say I have String s = "Ness" s= s+"Technologies"; What will happen? If the value gets appended, then what is the meaning of immutable here?
what is difference between String buffer and String builder?
Which browsers work with java?
How can you handle java exceptions?
What is the use of flag?