Questions tagged [curly-brackets]

The symbols "{" and "}", commonly used in programming languages. Please use this tag only if the specific usage of these symbols is a relevant part of the question.

The curly brackets (or braces) "{" and "}" are special cases of brackets, along with parentheses and square brackets ("[" and "]").

Curly brackets have many uses in most programming languages, such as:

  • identify code blocks;
  • create lists and arrays;
  • pass arguments to commands in TeX.
82 questions
0
votes
2 answers

Getting a syntax error that I can't fix

I am using the following code to try and catch all the errors that can occur for an audioPlayer. However, the very last brace creates a syntax error. Can anyone tell me why? It says: "Syntax Error, insert '}' to complete ClassBody" Code: public void…
-1
votes
1 answer

XSL for XML to Excel: Using a Curly Bracket in Formula

How do I use curly brackets in an XSL which generates an Excel file from an XML? I can accomplish what I want with an Excel formula, but it needs to use curly brackets list like: =LOOKUP(XXXX,…
Sean Perryman
  • 29
  • 1
  • 1
  • 7
-2
votes
1 answer

Putting an if-else statement in an if statement (Java on Eclipse)

I was working on some assignments I had for my java class, and I came across this error: public static final String ANSI_RED = "\u001B[31m"; public static final String ANSI_GREEN = "\u001B[32m"; public static void main(String[] args) { Scanner…
cjmgames
  • 11
  • 3
-2
votes
2 answers

Does (int i = 0; i < n; i++;) used as a block instead of {int i = 0; i < n; i++;} make any sense at all in C?

Don't know if it's a really dumb thing to ask as I feel it goes against C syntax.But I am not sure.I stumbled across that in a question posted few minutes back.The OP uses something like (int i = 0; i < n; i++), ie without even a ; after…
Rüppell's Vulture
  • 3,583
  • 7
  • 35
  • 49
-2
votes
3 answers

How do I know when to use {}

I am new to learning JavaScript. I am starting to get the hang of it but I am reviewing lines of code that I got from a book I am learning from ("Head First") and I am having a bit of a hard time understanding when to use {} Could you please help me…
-3
votes
3 answers

Missing a bracket, etc. (Swift)

Hi guys Im having trouble figuring out whats wrong. In the following function, when the category is Subtraction and the level Hard it skips past the function and goes to the division part. All my wording i believe is correct but I think something is…
Andy Lebowitz
  • 1,471
  • 2
  • 16
  • 23
-10
votes
2 answers

Math brackets in python?

Now I'm talking about MATH brackets, not python brackets, I know that parentheses () work like in maths, ex: i = 5*(2+2) print (i) #output = 20 But square brackets [] and curly brackets {} don't work... (I know why they don't work) Thank you, Using…
josh
  • 1,205
  • 4
  • 14
  • 14
1 2 3 4 5
6