File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

R long and Double literals?

 
Shyam kumar
Ranch Hand
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct answers to the question below are 1 and 2.
Why statement 5 is incorrect?

Select the correct answers:
1.Array indexes in Java always start at 0.
2.An instance variable declared in a class is created when an instance of the class is created.
3.An instance variable declared in a class is created the first time an instance of the class is accessed.
4.When an object is created, any instance variables which have not been assigned a value remain undefined.
5. The double and long primitive types are also known as literals.
 
wise owen
Ranch Hand
Posts: 2023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
3.10 Literals

A literal is the source code representation of a value of a primitive type (�4.2), the String type (�4.3.3), or the null type (�4.1):
Literal:
IntegerLiteral
FloatingPointLiteral
BooleanLiteral
CharacterLiteral
StringLiteral
NullLiteral


An integer literal is of type long if it is suffixed with an ASCII letter L or l (ell); otherwise it is of type int (�4.2.1). The suffix L is preferred, because the letter l (ell) is often hard to distinguish from the digit 1 (one).
..
A floating-point literal is of type float if it is suffixed with an ASCII letter F or f; otherwise its type is double and it can optionally be suffixed with an ASCII letter D or d.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic