nilesh bhil


{ City } amravati
< Country > india
* Profession *
User No # 42714
Total Questions Posted # 1
Total Answers Posted # 2

Total Answers Posted for My Questions # 2
Total Views for My Questions # 11705

Users Marked my Answers as Correct # 44
Users Marked my Answers as Wrong # 3
Questions / { nilesh bhil }
Questions Answers Category Views Company eMail

how and when compiler knows that the Java code throws the checked Exception.

HSBC,

2 Core Java 11705




Answers / { nilesh bhil }

Question { IBM, 53079 }

Difference between String & StringBuffer


Answer

String is immutable.
It means that we cant change the content of String once created. If we try append a new string using + operator
then it creates new String object.
ex.
string s = new String("Java");
s = s + "bean" ;// this statement creates new object.
String class does not have method that append new String to old String in object.


where as StringBuffer class is mutable. It means that we can add new String to it using append() method.
ex.
StringBuffer sb = new StringBuffer("Java");
sb.append("Bean");

Is This Answer Correct ?    38 Yes 3 No

Question { 4190 }

How to send a request to garbage collector?


Answer

Garbage collector is automatically called by JVM.
But can make the request by calling gc() method on System class as follows.
System.gc();
Note that we are making only request Garbage Collector may
called or may not called.
Garbage Collector is automatically called at two conditions.
1)When CPU is ideal.
2)When huge amount of memory is required.

Is This Answer Correct ?    6 Yes 0 No