0% found this document useful (0 votes)
3 views

Programming skills ppt

The document is a revision guide on Java programming, covering topics such as control statements, arrays, and method definitions. It includes true/false questions, multiple-choice questions, and code snippets to test understanding of Java syntax and concepts. Key topics include if statements, do statements, loops, array initialization, and variable types.

Uploaded by

satinder kaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Programming skills ppt

The document is a revision guide on Java programming, covering topics such as control statements, arrays, and method definitions. It includes true/false questions, multiple-choice questions, and code snippets to test understanding of Java syntax and concepts. Key topics include if statements, do statements, loops, array initialization, and variable types.

Uploaded by

satinder kaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

REVISION

Topic- JAVA Programming

Presented By:- Ms. Satinder Kaur


STATE TRUE OR FALSE. EVERY IF STATEMENT
MUST BE FOLLOWED BY AN ELSE OF ELSE-IF
STATEMENT.

TRUE

FALSE
IF THE CONDITION OF AN IF-STATEMENT IS
FALSE, WHICH IS TRUE BELOW.

A. IF block is executed.

B. ELSE block is executed.

C. Both IF and ELSE blocks are skipped.

D. Both IF and ELSE blocks are executed.


WHAT IS MAXIMUM LINES OF CODE THAT CAN
BE WRITTEN INSIDE A JAVA STYLE IF, ELSE OR
IF-ELSE BLOCK?

A. 32
B. 64
C. 512
D. None
CHOOSE THE CORRECT SYNTAX OF JAVA IF STATEMENT
BELOW.
A
if(condition) C
statement if(condition)
B {
if(condition) statement1
{ statement2
statement }
}
WHAT IS THE OUTPUT OF THE JAVA PROGRAM?

int horses = 10;


int camels = 5;
if(horses > 5)
{
if(camels > 3)
{

System.out.println("FOREST
");
}
}
else
{
System.out.println("CITY");
}
CONTROL STATEMENTS
WHAT IS TRUE ABOUT DO STATEMENT?

A. do statement executes the code of a loop at least


once

B. do statement does not get execute if condition is


not matched in the first iteration

C. do statement checks the condition at the beginning


of the loop

D. do statement executes the code more than once


always
…………………….. STATEMENT PROVIDES AN EASY WAY
TO DISPATCH EXECUTION TO DIFFERENT PARTS OF
YOUR CODE BASED ON THE VALUE OF AN EXPRESSION.

A. if-else
B. Switch
C. If
D. while
WHICH OF THE FOLLOWING LOOPS WILL EXECUTE
THE BODY OF LOOP EVEN WHEN CONDITION
CONTROLLING THE LOOP IS INITIALLY FALSE?

A. Do-while
B. While
C. For
D. switch
FOR(INT X=3;X<10;X=X+3)
STATEMENT WILL BE EXECUTED

A. 1 time
B. 2 time
C. 3 time
D. Compilation error
WHICH OF THESE IS AN INCORRECT STATEMENT?

A. It is necessary to use new operator to initialize


an array
B. Array can be initialized using comma separated
expressions surrounded by curly braces
C. Array can be initialized when they are declared
WHICH OF THE FOLLOWING IS FALSE ABOUT ARRAYS ON
JAVA

A. A java array is always an object


B. Length of array can be changed after creation of
array
C. None of these
WHAT IS THE TYPE OF VARIABLE ‘B’
AND ‘D’ IN THE BELOW SNIPPET?
INT A[ ], B;
INT [ ]C, D;

A. ‘b’ and ‘d’ are int


B. ‘b’ and ‘d’ are arrays of type int
C. ‘b’ is int variable; ‘d’ is int array
D. ‘d’ is int variable; ‘b’ is int array
WHAT IS THE RETURN TYPE OF A
METHOD THAT DOES NOT RETURN
ANY VALUE?

A. Int
B. Float
C. Void
D. double
WHICH METHOD CAN BE DEFINED
ONLY ONCE IN A PROGRAM?

 Main method
 Static method

 User defined method

 Standard method
THE VARIABLES DECLARED IN THE CLASS FOR
THE USE OF ALL THE METHODS OF THE CLASS
ARE KNOWN AS

A. Local variable
B. Static variable
C. Instance variable
JAVA.UTIL IS A..............

A. Class
B. Package
C. Method
D. All of the above

You might also like