What is the output of this program?
package pkg; class output { public static void main(String args[]) { StringBuffer s1 = new StringBuffer("Hello World"); s1.insert(6 , "Good "); System.out.println(s1); } }
Note : Output.class file is not in directory pkg.
What is the output of this program?
package pkg; class output { public static void main(String args[]) { StringBuffer s1 = new StringBuffer("Hello"); s1.setCharAt(1, x); System.out.println(s1); } }
What is the output of this program?
package pkg; class display { int x; void show() { if (x > 1) System.out.print(x + " "); } } class packages { public static void main(String args[]) { display[] arr=new display[3]; for(int i=0;i<3;i++) arr[i]=new display(); arr[0].x = 0; arr[1].x = 1; arr[2].x = 2; for (int i = 0; i < 3; ++i) arr[i].show(); } }
Note : packages.class file is in directory pkg;
Which of the following package stores all the standard java classes?
Which of the following is incorrect statement about packages?