Hi Ranchers please explain the following codes.when i run it gives output 00224466 is it vary or same bcaz 2 thread instance created.
but options are A 0 2 4 4 6 8 10 6 B 0 2 4 6 8 10 2 4 C 0 2 4 6 8 10 12 14 D 0 0 2 2 4 4 6 6 8 8 10 10 12 12
questions : class Thread1 { int x=0; public class Runner implements Runnable { public void run() { int cur=0; for (int i=0;i<4 ;i++ ) { cur=x; System.out.println(cur +" "); x=cur+2; } } }; public static void main(String[] args) { (new Thread1()).go(); } public void go() { Runnable r1=new Runner(); (new Thread(r1)).start(); (new Thread(r1)).start(); } }
Hi Ranchers please explain the following codes.when i run it gives output 00224466 is it vary or same bcaz 2 thread instance created.
but options are A 0 2 4 4 6 8 10 6 B 0 2 4 6 8 10 2 4 C 0 2 4 6 8 10 12 14 D 0 0 2 2 4 4 6 6 8 8 10 10 12 12
questions : class Thread1 { int x=0; public class Runner implements Runnable { public void run() { int cur=0; for (int i=0;i<4 ;i++ ) { cur=x; System.out.println(cur +" "); x=cur+2; } } }; public static void main(String[] args) { (new Thread1()).go(); } public void go() { Runnable r1=new Runner(); (new Thread(r1)).start(); (new Thread(r1)).start(); } }
I am most of the time confusing generics( where wild characters are used)
can anyone help me to get clean idea about the generic topic.any tutorial on generics please.i am reading from K&B from still i am unable to understand
class A { static{System.out.println("A");} }; class B { static{System.out.println("B");} }; class C extends B { static{System.out.println("C");} }; class D { public static void main(String[] args) { C c=new C(); } }
I am preparing to appear the test in next week.I have read khalid mughal and Kathy Siera book.Now i want to practice using Mock Test.Can anyone tell what is free doownloadable Mock test tool and sites for online Test
Hi Ranchers i am already read the khalid mughal and kathy siera book for scjp 1.4. now i want to give mock test for practice.Can any one tell what are available mock test tool and online practice.
What is need of beans.we can also create other class to get and set values. Then what is the need of get and set methods.can please explain it using some realtime example.