Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

vvus bharadwaj

Ranch Hand
+ Follow
since Apr 28, 2012
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 vvus bharadwaj

I passed OCPJP 6.0 exam.I came to know that for a certified person it is better to keep the logo in their resumes.So where can i download the logos and have it in my resume?Is it good to keep the logo?
How can i download the logo so that i can put it into my resume?
Is there any confirmation mail from oracle that i passed the exam?I do not receive any mails.
Ok i created a profile in oracle.com.But it is asking the company name in primary address.But i am a fresher and i gave my home address and i mentioned fresher in company.I gave the shipping address same as primary address.Is this right way?
In which site i can see the oracle certview profile?Is that in pearsonvue.com or oracle.com?I have the account in pearsonvue.com but i do not have the account in oracle.com.
I passed OCPJP 6.0 exam with 85%.I took this test on Friday(20-7-2012).At the center they gave me the printed copy of my result.How can i get the original certificate from oracle company.Please tell me the procedure.
I passed OCPJP 6.0 exam with 85%.I am very happy about my result because i got as i expected.Is this one a good result?I think as i am a fresher this is a good one.Will companies take this into the consideration at the time of recruiting ?Where should i add this to my resume?
I want to know whether Assertions errors can be caught and they can be handled or not?By handling the code completes normally or not?
T also want to know whether exception of type Error can be caught and handled or not?
I want to write the scjp6.0 exam.For that what is the procedure to apply for the exam.I registered in pearson vue site.I want the details about the money.
What is the cost of the exam?It is showing as 150$.How should i pay the money i.e through dollars or in indian currency?
Can i pay the money at the time of exam at center?
When to schedule for the exam?
Sorry.I posted it wrong.Actual command is

java-classpath . pack1.file1
Now i tried another example.Look at this.I do not specify any classpaths i.e in environment variable

This is the following directory structure.

Source|
pack1|
File1.java
pack2|
File2.java
I compiled the file2.java successfully and i got the class file.
Now i import the pack2.File2 in File1.java and i used the imported file in file2 class.I compiled the file2.java in pack1 directory only using "javac File2.java".It also successfully compiled.Why it has been compiled.You said that Javac look for only source files in current directory by default.I used the file2 class and it is in pack2 directory.I think javac looks for the source files and class files it needed in current directory by default.Is this right?

I dont know how to run this program.I used the following commands

I am in source directory.I used this command
java -classpath . pack1.File2
You said that we have to give the parent of root package directory.But this is not working.Please give methe correct command
I am still confused.Please explain this exapmle?
test|
GetJar.java|
myapp |
Foo.java
public class GetJar{
public static void main(String...a)
{
System.out.println(myapp.Foo.d);
}
}
package myapp;
public class Foo{
public static void main(String args[])
{
public static int d=8;
}
}

A)javac -classpath MyJar.jar GetJar.java
java GetJar

This answer is correct.why java does not use the classpath option.Jvac uses and why java does not use it?

Why this answer is wrong.
javac -classpath MyJar.jar GetJar.java
java -classpath MyJar.jar GetJar

Please clarify my doubt.i AM TOTALLY CONFUSED
1)I want to make sure that classpaths can be used only when we put classes into the packages.

2)You said that the path to the pack2 directory must be in the classpath.Can i set that path via command line?Please tell me the correct classpath for that?

3)Does javac command defaultly search for the current directory for .java files and class files it requires?
You said that it should work for Integers.Then why this code gets an error.


public class TrickyNum<X> {

private X x;

public TrickyNum(X x) {
this.x = x;
}

private double getDouble() {
return x.doubleValue();
}

public static void main(String args[]) {
TrickyNum<Integer> a = new TrickyNum<Integer>(new Integer(1));
System.out.print(a.getDouble());
}
}

I have given the generic type as Integer.When placing the Integer in place of X will be done.Whether it is at the time of compilation and run time.I know that at run time there is no generic information.So at compile time only it will substitute Integer in place of X and Integer class has doubleValue method.If this wrong please correct me.
My directory structure is like this.
Parent|
pack2|
B1.java
pack1|
A21.java



In the above problem I used A21 class in B1 class.I complied the file(i am in pack2 directory) without using classpath.Why it is compiled because i do not specify and search path to locate the A21.java?This is my problem.
After compiling i run the file using java B1(i am still in pack2 directory).Then it results in NoClassDefFoundErrorException:B1(wrong name:pack2/B1).Why?compiler able to see the class A21 and B1 but why JVM cannot able to see the B1 .Please tell me the reason and correct answers.

Also explain how the javac and java will look for the required classes i.e where they will start and where they will end the searching taking the case of with and without using classpath so that i can avoid the confusion regarding classpaths.
public class TrickyNum<X extends Object> {

private X x;

public TrickyNum(X x) {
this.x = x;
}

private double getDouble() {
return x.doubleValue();
}

public static void main(String args[]) {
TrickyNum<Integer> a = new TrickyNum<Integer>(new Integer(1));
System.out.print(a.getDouble());
}
}

Why this code resulting in compiler error?I assume that in the place of X Integer is substituting.Then Integer wrapper class has doubleValue() method.Is this right?If wrong please correct me.Also tell me what is happening at the compile time and run time with this code i.e when generic syntax will be substituted into the typing variables.