Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

 Java Unique Interview Question:-


Q) WAP to print data without using System.out.printlln()?

 import java.io.*;
class Addition
{
   public static void main(String args[]) throws IOException
   {
     FileOutputStream fo= new FileOutputStream(FileDescriptor.out)
     OutputStreamWriter o= new OutputStreamWriter(fo, "ASCII")
     BufferedWriter out = new BufferedWriter(o, 512);
     out.write("test string");
     out.write('\n');
     out.flush();

   } 
}

Q)  WAP to calculate addition without using + operator?

class Addition
{
   public static void main(String args[]) throws IOException
   {
     int a=100,b=20;
     while(b>0)
     {
         a++;
         b--;
     }
     System.out.println(a);

   } 
}


Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post