system- system is predefined class to provide access to the
out - out is the output stream used to connect the
println- println is method which is tell the compiler to
write a new line in our console
The System class contains serveral useful class
fields and methods.it cannot be instantiated
The out variable in the System class refers to (points
to) an instance of the PrintStream class (a PrintStream
object) which is automatically instantiated when the System
class is loaded into the application.
println()-the println() methods in class PrintStream.
System.out.prinln("HI DILIP ");
This statement invokes the println() method of an object of
the PrintStream class which is referred to (pointed to) by
the variable named out which is a class variable of the
If I will write
String s=new String("XYZ");
String s1=new String("XYZ");
This program will give me "True".
But When I am creating my own class suppose
public Employee(String name);
Employee e= new Employee("XYZ");
Employee e1 = neew Employee("XYZ");
Then it will give the output as "False".
Can I know what is happening internally?
how tha garbage collector know that the object will be
deleted? on which algorithm the garbage collector works?
what is the working principle of garbage collector? How
manay types of garbage collectors r there?