Download ICSE IMPORTANT 2 MARK QUESTIONS COMPUTER and more Summaries Computer science in PDF only on Docsity!
Java revisions
What are the character sets available in java?
Java uses character sets while writing a program. The
character sets are
- Letters
- Digits
- Operators
- Delimiters
What is an Unicode?
- It is a 16 bit code
- It uses hexadecimal to express a character
- capable to represent almost every character of well-known
languages of the world.
- Standard encoding system used to encode a character in any
computer language
What are escape sequence?
- Java have certain nongraphic characters (nongraphic characters are
those characters that can not be
- typed directly from keyboard e.g. backspace, tab, carriage return etc.).
- Those nongraphic character can be represented by escape sequence. An
escape sequence is represented by backslash followed by one or more
character.
- The few escape sequence characters are:
- \n - new line
- \t - Horizontal Tab
- \v - Vertical Tab
- \b – Backspace
- " - Double Quotes etc.
What are literals? How many types of integer literals
are available in Java?
- A literal is sequence of characters used in a program to represent a constant
value.
- It is otherwise called as constants.
- For example 'A' is a literal that represents the value A of type char, and 17L is
a literal that represents the number 17 as value of type long.
Different types of literals available in Java, they are:
- Integer literal
- Float literal
- Boolean literal
- Character literal
- String literal
- null literal
What is an identifier? What is the identifier
formatting rule of Java? OR What are the rules for
naming a variable?
- Identifiers are names given to different parts of a program
e.g. variables, functions, classes etc.
- The identifiers in Java
- Can contains alphabets, digits, dollar sign and underscore.
- Must not start with a digit.
- Can not be a Java keywords.
- Can have any length and are case-sensitive.
State the difference between = and ==.
- = is an assignment operator, which assigns value to a variable.
- == is a relational operator, which is used for checking equality or not of two items.
State the difference between token and
identifier.
- The smallest individual unit in a program ,such as keyword, identifier, literal, etc. is called a Token.
- Whereas, Identifier is a name given to a variable or class or object or array or a method.
5. State the two types of Java programs
Ans: - 1. Stand Alone Application
- Internet Applet
6. State the the difference between boolean
literal and character literal
Ans: - A boolean literal can be either 'true' or 'false' as its value. A character literal is composed of a single character enclosed within a pair of single quotes, e.g., 'A'.
8. Name OOP's principles.
- Ans: - Abstraction, Encapsulation, Inheritance, Polymorphism.
9. Define bytecode.
- Ans: - Bytecde is a platform independent Java instruction for the Java processor chip called JVM.
11. Define Encapsulation.
- Ans: - Wrapping of data and functions of a class together so that they can be applied as a unit to perform any operation is termed as Encapsulation.
12. Define Abstraction.
- Ans: - Abstraction refers to an act of representing essential features without including background details.