Skip to content

Tag: java

Java catch block, caught exception is not final

I am checking out the new features of Java SE7 and I am currently at this point: http://docs.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html regarding the catch multiple feature, when I came across this statement: Note: If a catch block handles more than one exception type, then the cat…

Java object, changed fields listener, design-pattern

There is a class: Then we update some fields How can I know which fields of MyClass were tried to be changed (invoked, in the example above field1 and field2)? What is the best solution for that? Maybe some design-pattern? One option is to create HashSet of changed fields for this object as an additional prop…

How to use OpenGL in JavaFX?

I want to write a very simple Java 3D editor(for experiment). I know the basic JavaFX usage, and I know enough OpenGL knowledge. But all my OpenGL experience is from working with C/C++. Could I make a ‘canvas’ in JavaFx application and map OpenGL viewport on it? Answer Internally, JavaFX can use O…

Where is the Java SDK folder in my computer? Ubuntu 12.04

I know it’s installed because when I type: I get: And when I type: I get: What worries me about the first item in the list is that the 2012a folder is my MATLAB folder and not a standard ‘usr/lib’ folder. I’m really confused on where the JDK and JRE got installed, because I need to set…

Call Java function using .Net(C#)

is it possible to invoke function which is written in Java using WCF or any class application written in C# .net Can it be possible by using webOrb.. i can’t find enough information about Java to .Net remoting.. Answer If you want to communicate between C# and Java you have a couple of options. The clea…

How to sort file names in ascending order?

I have a set of files in a folder, and all of them starting with a similar name, except one. Here is an example: I am able to list all the files from the specified folder, but the list is not in an ascending order of the spectrum number. Example: I get the following result when the program is executed:

Parenthesis/Brackets Matching using Stack algorithm

For example if the parenthesis/brackets is matching in the following: and so on but if the parenthesis/brackets is not matching it should return false, eg: and so on. Can you please check this code? Thanks in advance. Answer Your code has some confusion in its handling of the ‘{‘ and ‘}&#821…

Working on an RPN calculator code assignment in Java

This is my second programming class and I am new to Java. I have been working on my first assignment and it involves classes and methods. I know very little about these topics and find myself lost. My assignment asks me to create a RPN calculator that asks the user for two numbers and an operator. The calcula…