Shaun Wild

Greenhorn
+ Follow
since Apr 04, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 Shaun Wild

ekte spiriopoulos wrote:

Shaun Wild wrote:I'm not 100% sure what you're asking but I'm going to make some assumptions...

You want to throw an exception if ?

If so you need only do:



try-catch statements are used for catching thrown exceptions - not for throwing exceptions!

you solve it thank you.If it is not problem when i should use try-catch any example? on this exercise to understand it i will appreciate it



When to use try- catch statments...

If a method throws an exception (specified with the throws keyword), you must either encapsulate any calls to that method in a try- catch or ensure that the method that is calling it throws the same exception. For example, in Java, Thread.sleep(long ms) is a function that throws an InterruptedException. So to call it you must encapsulate it in a try- catch as follows:



You can also make sure taht the method calling it throws the same exception too:



Just bare in mind that any method calling sleep(ms) would have to encapsulate sleep in a try- catch.

6 years ago
throw

the throw keyword in java allows you to throw an exception, this will cause a program to terminate unless it is caught in a try- catch statement.

throws

the throws keyword in java allows you to say "this method may throw this exception", a user calling this method will be required to place it in a try-catch statement an example of this:



This method uses both of the keywords, it will throw an Exception if result < 0 and it also tells the user that the method can throw an IllegalArgumentException.
6 years ago
I'm not 100% sure what you're asking but I'm going to make some assumptions...

You want to throw an exception if ?

If so you need only do:



try-catch statements are used for catching thrown exceptions - not for throwing exceptions!
6 years ago
You can use the target attribute on your <a> tag to change the behavior when it's clicked.

From w3 school...

_blank Opens the linked document in a new window or tab
_self Opens the linked document in the same frame as it was clicked (this is default)
_parent Opens the linked document in the parent frame
_top Opens the linked document in the full body of the window
framename Opens the linked document in a named frame

So in your example:

<a class="hexIn" target="_blank" href="#">
The error basically tells you what is going wrong...

It says on line 14, the attribute "target" evaluates to null or "", so

14: <c:set target="${skuLinksFormHandler}" property="initializeSkuLInkInfos" value="${sessionScope.atgCurrentAsset.asset}" />

namely...

${skuLinksFormHandler}

is null or ""
6 years ago
JSP
You may want to consider rewording this thread or being more specific, I really can't make out what you're actually trying to achieve.
6 years ago
The error is caused by this this part of your code:



When you type



You're setting the entire array to the last char you typed, which means the array is only 1 char long which gives you your exception when you try to access any index higher than that later on in your code.

Instead I suggest you use



Hope this helped
6 years ago
I won't delve into helping you solve your boolean algebra problem however I can link you this useful resource:

http://www.allaboutcircuits.com/textbook/digital/chpt-7/boolean-rules-for-simplification/

As for your Ternary operators, think of them as shorthand functions to take a boolean and output one of two values depending on whether the boolean is true or not. For example:





You can also use expressions



You can also chain multiple together (However I don't recommend doing this as it seriously hurts the readability of your code.



Hope I helped shed some light on that for you

6 years ago