How to Simulate System.out.println

How to Simulate System.out.println() ?

// Class A Will Work like PrintStream Class
class A
{
// printp Function will replace println()
public void printp()
{
System.out.println("Testing");
}
}

// Class B Will Work like System Class
class B
{
//Here a is like out
public static A a=new A();
}

class C
{
public static void main(String args[])
{
// System.out.println();
B.a.printp();
}
}

Watch Following Video to Learn in Detail :

1 comment: