what is mean by String and StringBuffer?
What is mean by Methooverriding and Overloading?

Answers were Sorted based on User's Feedback



what is mean by String and StringBuffer? What is mean by Methooverriding and Overloading? ..

Answer / vijayakumar chinnasamy

String:
1. Is final class.
2. Is immutable class i.e value can't change once it is
assigned.
3. When your text is not going to change ,then you use the
String.
4. is not thread safe


StringBuffer:

1. is final class.
2. is mutable object.
3. When your text is going to change and will be accessed
from multiple threads , then you use StringBuffer
4. is thread safe .

Method Overloading:
1. Morethan one method has same name and either the number
of argument or data type of arguments are differ.
2. Method can be overloaded in same class or its subclass.
3. Return type ,access specifier and throws Exception are
not part of overloading.
4. static method can be overloaded by nonstatic method.

Method Overriding:
1. A method has same name,return type, number of argument
and arguments data types are same in subclass and super class.
2. The subclass (inheriting) method has equal or higher
access specifier than it superclass method.
3. The subclass (inheriting) method's throws exception is
equal or subclass excpetion of superclass method(Inherited
class method).

Is This Answer Correct ?    7 Yes 0 No

what is mean by String and StringBuffer? What is mean by Methooverriding and Overloading? ..

Answer / ravi

String is a final class which represents a character
string,string are constant they value cannot be changed
after they r created
its is final class Stringbuffer,Stringbuffer implemets
muttable String character,its is like a string but can be
modified, the length and content can be changed during
method call

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Core Java Interview Questions

why java main method is given as static method?

2 Answers  


What is jit compiler in java?

0 Answers  


What is the return type of readLine() when end of a file is reached?

2 Answers  


What are static initalizers in java ?

0 Answers  


What is the difference between super class & sub class?

0 Answers  






What is the difference between an interface and an abstract class?

0 Answers   Cyient,


what are the oops concept in java explain with real time examples

24 Answers   Accenture, Bosch, Consummate Technologies, CTS, Current Technologies, iNautix, Infosys, Kekran Mekran, QA InfoTech, RTRT, SofTech, Tech Mahindra, Thorogood, Timios, Wipro,


import java.io.*; class Demo { public static void main(String args[]) { File f=new File("1234.msg"); String arr[]=f.list(); System.out.println(arr.length); } }

3 Answers   IBM, Ramco,


methods in Applet?

1 Answers  


What is object cloning in Java?

0 Answers   SwanSoft Technologies,


Explain Linked HashSet

1 Answers  


What is the purpose of having the concept of overloading?

7 Answers   Ness Technologies,


Categories