aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Java Versions - i m worried !!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Java Versions - i m worried !!!" Watch "Java Versions - i m worried !!!" New topic
Author

Java Versions - i m worried !!!

Shah Chunky
Ranch Hand

Joined: Dec 27, 2000
Posts: 116
Hello all...
Today i found that one can check their version of Java by typing
"Java -version" at command prompt
Before i started leaning java ( Some 6 months back) i installed JDK 1.2.1
But today when i checked the version using above command, it showed me:-
java version "1.3.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_01)
Java HotSpot(TM) Client VM (build 1.3.0_01, mixed mode)
Now i m really worried as when did i installed 1.3.0_01 version.
Since i have come to know that JCP is based on 1.2 version, i m really scared
as the R&D that i have done on Java will be based on 1.3 Version.
I found the following code in one of the Mock Test :-
byte b = 65;
switch (b)
{
case 'A':
System.out.println("A is printed ");
}
I came to know that the above will not work in JDK 1.2, but will work on 1.3
& when i ran it, it was working w/o errors.
But when i checked the JDK installed, it was JDK 1.2.1
i.e. i m setting path as c:\jdk1.2.1\bin everytime i want to compile & run Prog
The reason i m really scared is that i m plng to appear for JCP in 15 days.
Is there anything to worry.
Thanks.


Shah Chunky - Sun Certified Java2 Programmer.
Greg Georges
Ranch Hand

Joined: May 10, 2001
Posts: 116
No need to worry Shah. All versions of jdk are backwards compatible. The version of jdk 1.3 introduced some minor changes, but nothing important. The introduction of JRE 1.3 was great because hotspot technology was introduced which ran applets in a browser much faster than the JRE in 1.2 and versions before it.
Also, I cannot think of any classes or methods which are deprecated (this term in Java means that the class or method is put asside because a better class or method nows exists which has the same functions) from JDK 1.3 which we need to know for the SCJP exam.
I myself use JDK 1.3, so do not worry, keep writing your code and study hard.


<b>Greg Georges</b><br /><i>Sun Certified Java Programmer for the Java2 platform (SCJP)</i><br /><i>Sun Certified Java Developer for the Java2 platform (SCJD)</i>
Scott Appleton
Ranch Hand

Joined: May 07, 2001
Posts: 195
This makes me wonder, though, if you get a question on the test such as will the following code compile:

What would the proper answer be, given that it fails in 1.2 but does not in 1.3? The test is supposed to cover 1.2, so my guess is that you'd have to say it fails -- but I'd hate to find myself studying a code fragment knowing that it works in 1.3 but trying to remember whether it worked in 1.2 or not.
shailesh sonavadekar
Ranch Hand

Joined: Oct 12, 2000
Posts: 1874
Shah Chunky , As per Sun's objective , the exam will be based on Java Version 1.2. So , i feel you must have jdk1.2.2 installed.

Today i found that one can check their version of Java by typing
"Java -version" at command prompt
Before i started leaning java ( Some 6 months back) i installed JDK 1.2.1
But today when i checked the version using above command, it showed me:-
java version "1.3.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_01)
Java HotSpot(TM) Client VM (build 1.3.0_01, mixed mode)

i think you have to do one thing : -
Go to control panel if you are using windows 95 , 98 etc. , go to add / remove program & remove JRE 1.3.
Then , check again your version. You should get 1.2.2.
check your path & classpath in autoexec.bat file & set them properly.
It is true that certain things that work in jdk1.3 will not work in jdk1.2.2.
I hope this will be useful.
Your Friendly Bartender
Shailesh.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
I have a feeling that there are no questions on the actual test that will cause this kind of confusion.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Shah Chunky
Ranch Hand

Joined: Dec 27, 2000
Posts: 116
Can someone having JDK 1.2 run the below code & tell me whether u get an Error or Not ... Please this is urgent...
public class Numeric2
{
public static void main(String[] args)
{
Numeric2 n = new Numeric2();
System.out.println("Hello ");
byte b = 65;
switch (b)
{
case 'A':
System.out.println("Proin");
}
System.out.println();
}
}
Thanks.
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi Shah, Scott ...
JDK 1.3 corrects some bugs that were in JDK 1.2. According to the JLS, the example should compile and run cleanly as a 'byte' can be legally used in a switch test.

JLS §14.10
The type of the Expression must be char, byte, short, or int, or a compile-time error occurs.

If you saw such a question on the exam you'd have to assume it compiles because the JLS says it will.
As JDK 1.3 behaviour is closer to the actual JLS I think you're safe using it.
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
If you are worried now, see this thread:

http://www.javaranch.com/ubb/Forum47/HTML/000013.html
------------------
Co-Moderator of the Programmer Certification Forums
Prasanna Wamanacharya
Ranch Hand

Joined: Apr 24, 2001
Posts: 143
Hi Chunky, I just compiled the code on JDK 1.2.1, and it compiles, and executes fine.
You really don't have to worry about the versions. I sat for the test on 21st May 2001, and I did not get any question which could put doubt in my mind regarding the versions.
Hope that Helps.
Prasanna
SCJP2
Shah Chunky
Ranch Hand

Joined: Dec 27, 2000
Posts: 116
But can someone tell me which version i have ?
i.e. when i type "java -version" it shows JRE 1.3,
whereas i am Setting path as c:\jdk1.2.1\bin.
So which version i m using ?
Thanks.
[This message has been edited by Shah Chunky (edited May 25, 2001).]
[This message has been edited by Shah Chunky (edited May 25, 2001).]
[This message has been edited by Shah Chunky (edited May 25, 2001).]
shailesh sonavadekar
Ranch Hand

Joined: Oct 12, 2000
Posts: 1874
jre 1.3 means jdk1.3
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi Shah,
I'm not 100% sure but try checking the following:
1. Do you have a CLASSPATH setting? Is it pointing to the JDK 1.2.1 bin directory? I think Java will use the classes specifically in the classpath.
2. Run 'regedit' and take a look under HK_LOCAL_MACHINE -> Software -> JavaSoft. Is there a folder for 'Java Development Kit'? If so, what version shows up? One of them will be marked as the 'current version'. The 'Java Runtime Environment' is the JVM that's being used when you execute an application.
Hope that helps.

------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
 
subject: Java Versions - i m worried !!!