rutuparna andhare

Greenhorn
+ Follow
since Oct 29, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by rutuparna andhare

there is only one dos(disk operating system)?

classpath is set.
when i say javac first.java --->it says javac not recognised command

what to do in this situation
14 years ago
hello,
System.out.println('\u0905');------------------>gives ?
but
unicode char says that '\0905' --------> devanagri A

how to handle this problem.



Raju Champaklal wrote:hey am giving the exam on 31st...any suggestions...please.. am terrified....


make good final review notes,and give exam with cool mind.
prometric exam is just like Examlab
14 years ago
hi , i am instrumentation engineer.
passed with 83%.

thanks to Bert Bates Ankit Garg marc weber Jesper Young and Devaka Cooray for wonderful examlab
and all java ranch contributer .
14 years ago
i just paid cash in prometric center.
they ask me about email id and pan card number?
they give me the voucher number.

but i dont get any email.
i have perchased voucher online via a prometric center(cash) .i got voucher number.
where should i know the details of voucher i.e last date etc..

Ankit Garg wrote:rutuparna please UseCodeTags when you post a source code. Unformatted code is very hard to read so edit your post using button and then add [code] [/code] tags around your source code...




[code].........[/code]
but not getting formated source
[code]
public class test implements Runnable
{
public void run()
{
try
{
synchronized("a")
{
System.out.println("before-->"+Thread.currentThread().getName());
"a".wait(5000); // line 1
System.out.println("after-->"+Thread.currentThread().getName());
}
}
catch(InterruptedException ie){}
}

public static void main(String [] str)
{
test work=new test();
Thread t1=new Thread(work); t1.setName("t1");
Thread t2=new Thread(work); t2.setName("t2");

t1.start();
t2.start();
}

}
[/code]
according to my view i want to see answer like this
(
before t1 ---- minimum 5 sec-- after t1
before t2 ---- minimum 5 sec-- after t2
)

but output is like this-->
before--> t1 before-->t2 5sec wait after -->t1 after--> t2

question? as sync code allow one thread to inside
then why output is "before t1 before t2"
how both thread access sync code?


and please explain sync "a" "a".wait ?
book k and b 6.0
page 804 last paragraph
"remember when using classpath,
the last directory in the path must be the super-directory of the root directory for the package" and explanation ...

test
|--b.java (public class b extends a { public static void main(String [ ]str){} }) import myapp.utils.*;
|--ws
......|--myapp
..............|--utils
.....................|--a.class (public class a{}) (package myapp.utils)

i applied cp according to book such as

cd test
javac -cp ws b.java // it compiles

java -cp ws user // exception in main --NoClassDefFound



whats missing ? help?
thanks in advance







why enum not gives an error at second SOP? and what a.b means i.e how to read it.

public enum E
{
a(1),b(2),c(3);

int i;
E(int i){this.i=i;}

public static void main(String [] str)
{
System.out.println(a); //1// output-->a
System.out.println(a.b); //2// output-->b not able to understand a.b ?
}
}

as in normal class

public class C
{
int i;
C(int i){this.i=i;}

public static void main(String [] str)
{
C a=new C(1);
C b=new C(2);
System.out.println(a.b); // compiler error
}

}




why enum not gives an error? and what a.b means i.e how to read it.
if we use comparator using another class
and gives obj of it ,to sort and search then it works

but using comparable gives error as per above
if anyone find problem then please submit answer
i respect everyones thought
i think this will help

i think E is confusing ! right

public <T extends E> A<? super T> getNow(A<? super T> a)

in this sentance whatever is in argument A<----T---> relates to leftside <T extends E> but only and only for class "A"

to check this you can
compile this code
--------------------------------------------------------------

public class TestGeneric
{

public static void main(String [] args)
{
A<Integer> a = new A<Integer>();
new GenClass<B>().getNow(a);
}
}

class A<E>
{
static void call()
{
System.out.println("in class A");
}
}

class B extends A
{
static void call()
{
System.out.println("in class B");
}
}

class C extends B
{
static void call()
{
System.out.println("in class C");
}
}

class D { }

class GenClass<E extends A>
{
public <T extends E> A<? super T> getNow(A<? super T> a)
{
E.call(); // shows what type of class E is
return new A<A>();
}

static void call()
{
System.out.println("in class GenClass");
}
}
------------------------------------------------------------------------------------
it compiles fine (notepad & dos) jdk 1.6
there are two views to solve this type of problem
1 view>

paramether passing must be same as argument
A<Integer>a=new A<Integer>();
parameter a i.e A<Integer>
argument A<? super T> //anythig whos super is T

2 view>

so what is T ?
see left <T extends E>
so what is E ?
A<E>
again what is E?

in main
we wrote that
A<Integer>a=new A<Integer>();
-------------------------------------------
so Integer Integer matches
unicode character :thumbup:
it is indian language marathi