0 of 50 questions completed
Questions:
Instructions:
Total number of questions : 50.
Time alloted : 50 minutes.
Each question carry 1 mark, no negative marks.
Attempt all questions.
DO NOT refresh the page.
All the best :-).
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
0 of 50 questions answered correctly
Your time:
Time has elapsed
You have scored 0 out of 0 points, (0)
Average score |
|
Your score |
|
What is the range of data type short in Java?
Which of the following are legal lines of Java code?
An expression involving byte, int, and literal numbers is promoted to which of these?
What is the output of this program?
class conversion {
public static void main(String args[])
{
double a = 295.04;
int b = 300;
byte c = (byte) a;
byte d = (byte) b;
System.out.println(c + ” ” + d);
}
}
What is the output of this program?
class increment {
public static void main(String args[])
{
int g = 3;
System.out.print(++g * 8);
}
}
Which of these coding types is used for data type characters in Java?
What is the output of this program?
class array_output {
public static void main(String args[]) {
char array_variable [] = new char[10];
for (int i = 0; i < 10; ++i) {
array_variable[i] = ‘i’;
System.out.print(array_variable[i] + “” );
i++;
}
}
}
What is the output of this program?
class mainclass {
public static void main(String args[])
{
char a = ‘A’;
a++;
System.out.print((int)a);
}
}
What is an immutable object?
Which of the following is not a valid way to create String object?
String objects are stored in a special memory area known as?
What will be the result of given code?
String str = “Java”;
String str1 = new String(“Java”);
System.out.println(str.equals(str1));
System.out.println(str == str1);
System.out.println( str.compareTo(str1) );
What will be the result of given code?
String str = “StudyTonight”;
str.concat(“.com”);
str = str.toUpperCase();
str.replace(“TONIGHT”,”today”);
System.out.println(str);
Which method is used to convert a primitive type into String?
Which method is used to remove leading and trailing whitespace(s)?
What will be the output of following code?
String str = “Java was developed by James Ghosling”;
System.out.println(str.substring(19));
Which of the following is not a valid declaration of a Top level class ?
A special method that is used to initialize a class object ?
Two methods are said to be overloaded if they have,
What will be the output of the program ?
class A
{
int x = 10;
public void assign(int x)
{
x = x;
System.out.println(this.x);
}
public static void main(String[] args)
{
new A().assign(100);
}
}
this keyword in java is used to ?
Which method is called by Garbage collection thread just before collecting eligible Objects ?
Garbage Collection in java is done by who?
Can you make a Constructor final ?
Which is true?
What will be the Output?
class Animal
{
String name = “animal”;
String makeNoise() { return “generic noise”; }
}
class Dog extends Animal
{
String name = “dog”;
String makeNoise() { return “bark”; }
}
public class Test
{
public static void main(String[] args)
{
Animal an = new Dog();
System.out.println(an.name+” “+an.makeNoise());
}
}
Which of these keywords is used to manually throw an exception?
What is the output of this program?
class exception_handling {
public static void main(String args[]) {
try {
System.out.print(“Hello” + ” ” + 1 / 0);
}
catch(ArithmeticException e) {
e.printStackTrace();
System.out.print(“World”);
}
}
}
The class at the top of exception class hierarchy is ……………..
In which of the following package Exception class exist?
Which keyword is used to specify the exception thrown by method?
What happen in case of multiple catch blocks?
What will be the output?
class MyClass{
public String test(){
try{
System.out.print(“One”);
return “”;
}
finally{
System.out.print(“Two”);
}
}
}
public class Test{
public static void main(String args[]){
MyClass m = new MyClass();
m.test();
}}
Will the following code creates a new file named a.txt?
try{
File f = new File(“a.txt”);
}catch(Exception e){
}catch(IOException io){
}
When a class extends the Thread class , it should override ………… method of Thread class to start that thread.
What will be the output of the following program code?
public class Test implements Runnable{
public static void main(String[] args){
Thread t = new Thread(this);
t.start();
}
public void run(){
System.out.println(“test”);
}
}
Which statement is true about the following code?
public abstract class Test implements Runnable{
public void doSomething() { };
}
What is the output of the following code?
public class Test implements Runnable{
public static void main(String[] args){
Test t = new Test();
t.start();
}
public void run() { }
}
Which of the following are methods of the Thread class?
1) yield()
2) sleep(long msec)
3) go()
4) stop()
What does notifyAll() method do?
Which keyword when applied on a method indicates that only one thread should execute the method at a time.
A process can be
Which packages contain the JDBC classes?
How can you retrieve information from a ResultSet?
How can you execute DML statements (i.e. insert, delete, update) in the database?
What is, in terms of JDBC, a DataSource?
How can you execute a stored procedure in the database?
What is correct about DDL statements (create, grant,…)?
Can DISTINCT command be used for more than one column?
On executing DELETE command, if you get an error “foreign key constraint” – what does it imply?
Connect with
Login with GoogleCopyright 2025 ipsr solutions ltd.
Powered by ipsrjobs.com