sepp2k's Profile User Rating: *****

Reputation: 2261 Grandmaster
Group:
Mentors
Active Posts:
3,478 (2.32 per day)
Joined:
21-June 11
Profile Views:
57,567
Last Active:
User is offline Private
Currently:
Offline

Previous Fields

Country:
DE
OS Preference:
Linux
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Expert In:
C/C++, Functional Programming, Java, Python, Computer Science
Icon   sepp2k has not set their status

Posts I've Made

  1. In Topic: Parsing Error?

    Posted 27 Jul 2015

    At a glance I see three problems:

    • All executable code should be inside methods, not after the class body.
    • An if should be followed by an opening brace, not a closing one.
    • Update 6: ... is just invalid syntax. Update6: would be valid syntax for creating a jump label, but I don't think that was your intention here - especially as you never jump to it (nor should you).


    PS: In the future, please post code on the forum inside code tags rather than as a link.

    Oh and you seem to have a lot more closing braces than opening ones.
  2. In Topic: Calculate age

    Posted 24 Jul 2015

    When posting in the Other Languages forum, please specify which language you're asking about (preferably in the title) and if the language has its own subforum (which would be the case if this code should happen to be Java), you should ask in that subforum instead. When asking about an error in any forum, you should also provide the error message (verbatim) as the usually tells you what's wrong. Even if you don't understand it, the people answering your question usually will, so this greatly simplifies finding the problem.

    That said, it looks like your problem might be that you have a method that's declared to return an int, but doesn't actually contain a return statement.
  3. In Topic: Why does my code give an error 'no viable alternative at input def

    Posted 23 Jul 2015

    You don't write Xtend code into your Java files (and certainly not inside your main method), you write it into Xtend files. It's its own language.

    PS: Having a method named someHTML that returns a bunch of C code is wee bit confusing terminology wise.
  4. In Topic: creating an instance using different constructor

    Posted 22 Jul 2015

    In the second line you didn't give your variable a name. It should be something like NaiveString b(a);. NaiveString(a) would only work if you used it to create a temporary object within an expression like myfunction(NaiveString(a)); - not to declare a variable (as variables need to have a name).
  5. In Topic: Can someone explain why this is behaving the way it is?

    Posted 22 Jul 2015

    View Postmstashev, on 22 July 2015 - 06:52 PM, said:

    So I am working on an assignement where we are supposed to have an array, and then, using
     public static <E extends Comparable<E>> E max(E[] list) 
    
    method, display the last element in the array.


    To get the last element of an array you do arr[ arr.size - 1 ]. That's not what your max method does nor is it what one would expect a method with that name to do.

    What max does is it returns the largest element of an array. So given the integer array {1, 23, 42, 13, 7}, it would return 42, not 7. For strings the "largest" element is defined to be the one that'd come last if you sorted the array lexicographically by the characters' numeric Unicode values (which is also how Java's sort methods will sort collections of strings if no custom comparator is provided). By that sort order, digits sort before letters, which is why letters always win over digits in your test.

My Information

Member Title:
D.I.C Lover
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Years Programming:
15
Programming Languages:
Haskell, Ruby, OCaml, SML, F#, Scala, Racket/Scheme, Vala, C#, C++, Java

Contact Information

E-mail:
Private
ICQ:
ICQ  205544826
Jabber:
Jabber  sexykane86@jabber.ccc.de