12 questions
What is the difference between public and private keyword in java
private: accessible within the same package only
private: accessible within the same class only
public: accessibly from anywhere
public: Accessible only for output generation.
Non of the above
Java is a
OIP-Object intended Program
POP - Procedure Oriented Programming
OOP - Object Oriented Programs
High Level Language
Data is encapsulated by using the keyword....
public
protected
private
None of these
Why can't one install BlueJ for Windows on a Mac
Because they have different architectures
Their OSs are different
No... we can do so.
None of these
The loop code for the series
2, 4, 7, 12, 21....... n is :
for(int i = 1; i<=n;i++)
{
System.out.println(_________);
}
Fill in the blank.
I + math.pow(i,2)
i + math.pow(i,2)
I + math.pow(2,I)
i + math.pow(2,1-i)
i + math.pow(2,i-1)
Which of the following are InValid
int AMAZING LIFE;
int School_Marks;
int 9thSeriesInput;
int class
do we have to import java.lang.*; separately
Yes.... we have to
No, we do not have to do it separately it is imported with java.util.*;
No... we do not have to
None of the following
what is System.in's output area by default
Console
Terminal Window
Keyboard
Non of the above
If(a==b)
{int c = 1+b+a;}
else
{int c = 1+b+a;}
System.out.println(c);
Tick the option that would give the same output
int c = 1+b+a;
System.out.println(C);
int c = (a==b)?1+b+c:1+c;
System.out.println(c);
double c = (a==b)?
1+b+c:1+b+c;
System.out.println(c);
int c = 1+b+a;
System.out.println(c);
In Java, each and every character is considered to be a
Single lexeme
Basic lexical element
Single Basic Lexical lexeme element
None of these
char ab = 'a';
char bc = 'A';
int a = Math.pow(ab,bc-64);
System.out.println(a);
What is the output
9409
0
-9409
None of these
What is the output:
int i = 12;
i = i +1;
i = 1;
i*=i*i-1;
System.out.println(i);
1
2
13
None of these