Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Jaspreet Saran

+ Follow
since Mar 01, 2014
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jaspreet Saran

Thanks Giovanni Montano

it works but with very small change, when i made the key Prefs, windows prompt that it already exist somewhere.
I found that it is here: HKEY_USERS\S-1-5-21-2986116552-1422457668-3418972334-1000\Software\JavaSoft\Prefs

but I made a key in the path you specified, and named it as 'prefs' not as 'Prefs'. [ all in small ]
It works and now I am not getting any warning.

here is the full story for Java HeadFirst Readers. It might help you in case you too got this warning :

Especially with Windows 7, the JVM has not by default the permission to write into the Windows registry where the backing store for java.util.prefs.preferences is located under MS-Windows.
When executing either the ReverseXSL transformer, or even the Regex tester program, one can get errors like: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx
This does prevent registering a license. It does not prevent the software to perform transformations in the free software mode.
Fixing the issue is simply a matter of granting the necessary permissions to the registry root key at stake.
Run regedit.exe as administrator (regedit.exe is located in the c:\Windows operating system root directory).
Right click to set permissions. Check a mark in the Full Control check box for the user(s) that need executing the reverseXSL software.
6 years ago
hello everybody,
I have one problem with this app, not related to this whole thread of discussion , but i m not creating new post , i think problem is not big one.
when I run the following code from Java HeadFirst, everything goes fine but along with one error ( i don't know is it an error or exception, or some other windows stuff)
The code is

and what i got on cmd ( I am using Windows 7) :

Jaspreet javac

Jaspreet java ExceptionHandling
Jun 11, 2014 5:19:40 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0
x80000002. Windows RegCreateKeyEx(...) returned error code 5.

we got the sequencer

What is meant by code in blue?
I know its some message from windows os and not from jvm. but i didn't understand it. please explain me....
Thanks to javaRanch and its team members.
6 years ago
hmm I am sorry sir, actually I was thinking of int, char, boolean, I didn't noticed sorry.
But thankful to you and to the JavaRanch.
6 years ago

Henry Wong wrote:
An int variable is of a primitive type. A Boolean variable is of a reference type. And since only objects cam implements interfaces, a NullType variable is also of a reference type.


A boolean variable is of a reference type? ....please explain me how?.... A variable declared as a boolean does not hold reference to some object...instead it hold primitive literal value..true or false.
whatever, may be i am wrong here... i have started java just 3- 4 months please explain.... your line

A Boolean variable is of a reference type.

And thanks sir one question is clear that null type is a reference type.
6 years ago
Sir i want to ask one question related to this...
like int, Boolean,etc comes under category of primitive types in java, does nullType come under reference type?
Or its just the third category of Java Data Types.
I have read somewhere that Java data types are classified into three categories: primitive, reference and nullType...
i do not agree with it. Boolean is also a special type, which can hold only two special literal true or false. but we cannot say its not primitive but some other special type..
similarly null type is a reference type but is special which can hold only one literal null.
and as you all said it can be upcast to any other reference type.
please clear my concept...
6 years ago
thank you all for replying to this question....n sorry my keyboard was not working so there are lot of spelling mistakes in my reply.....Well i got it shy java doesn't support....but i would love it if it support.....because i can make a class with which i can play with operators too.....but i understood that it also lessen the security of so many can misuse the operators over they did not add this feature...ok thanks again.
6 years ago
thank you sir/ mamomeone ask me this q but what should i say if suestion on an interview?
As usually they ask why there are no pointers in java....and many suck things.
well there are pointers in java too but only JVM can understand them and can use them. we cannot. this add to the security feature of java.
... while i was writing code to add two complex numbers ( I am a beginner to java So don't know the API's class to do this, so i made my own, its simplest thing)...
then this question arose in my mind. well if java support it would be helpful.
anyway if it doesn't no problem.
again i need some clearer reason if anybody can, please?
6 years ago
Why Java does not support operator overloading?
well, I think it would need more complex compiler and JVM. Or java do not want user to override operator's default working.
But i know its importance. Default operator definition is for primitive types only but what for new types like classes. anyway there must be a genuine reason for it too. I Want to know.
Please sir/mam, Do reply to this and I want exact reason.
Thank you.
6 years ago