Advertisements
Advertisements
Question
What are keywords ? Give an example.
Solution
Keywords:
Keywords are reserved words in Java, which have a special meaning in the language.
Example: if, void, int, etc.
APPEARS IN
RELATED QUESTIONS
Name any two basic principles of Object-oriented Programming.
Name any two OOP’s principles.
What are identifiers?
Name the type of error ( syntax, runtime or logical error) in each case given below:
(i) Math.sqrt (36 – 45)
(ii) int a;b;c;
Write a function prototype of the following:
A function PosChar which takes a string argument and a character argument and returns an integer value.
Give the output of the following expression:
a+= a++ + ++a + -- a + a--; when a = 7;
Using the switch statement, write a menu-driven program for the following:
(i) To print Floyd’s triangle [Given below]
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
(ii) To display the following pattern:
I
I C
I C S
I C S E
For an incorrect option, an appropriate error message should be displayed.
Which of the following are valid comments ?
(i) /* comment */
(ii) /* comment
(iii) / / comment
(iv) */ comment */
Give two differences between the switch statement and the If-else statement.