Free IT Courses Java Worksheets

Download free printable Java Worksheets to practice. With thousands of questions available, you can generate as many Java Worksheets as you want.

Download Worksheet

Sample IT Courses Java Worksheet Questions

1.

Who Calls main() function in C/JAVA Programming language?

1.

Java Compiler

2.

Java Runtime Environment

3.

Operating System

4.

Java Virtual Machine

5.

None

2.
What is the output?
 public class Test {
    public static String out ="";
    public static void chk(int i) {
 	try {
	   if(i==1) {
	      throw new Exception();
	   }
	   out += "A";
	 }
	 catch(Exception e) {
	    out += "D";
	    return;
	 }
	 finally {
	    out += "B";
	 }
	 out += "C";
     }       
     public static void main (String [] args) {
       chk(0);
       chk(1);
       System.out.println(out);
     }
 }

 

1.

DBCAB

2.

ADBCDB

3.

ABCD

4.

ABCDB

3.

when constructor will be called 

1.

By calling method

2.

by creating object of that class

4.

Iterator cursor is having both directional movements?

1. True 2. False
5.

Is Vector thread safe ?

1. True 2. False
6.

in which collection in java insertion order preserved ?

1.

Arraylist

2.

Linkedlist

3.

Vector

4.

Stack

7.

ArrayList  implements Random Access interface.

1. True 2. False
8.

public class Exercise {

    public static void main(String[] args) {
        
        double x = 4.0 - 3.10;
        
        //System.out.println(x);
        
        System.out.println(x == 0.90);
    }
}

1. True 2. False
9.
class demo

{

    int a, b;

     

    demo()

    {

        a = 10;

        b = 20;

    }

     

    public void print()

    {

        System.out.println ("a = " + a + " b = " + b + "\n");

    }

}

 

class Test

{

 

    public static void main(String[] args)

    {

        demo obj1 = new demo();

        demo obj2 = obj1;

 

        obj1.a += 1;

        obj1.b += 1;

 

        System.out.println ("values of obj1 : ");

        obj1.print();

        System.out.println ("values of obj2 : ");

        obj2.print();

 

    }

}
1.

values of obj1 :

a=11,b=21

values of obj2:

a=11 b=21

2.

values of obj1 :

a=11,b=21

values of obj2:

a=10 b=20

3.

compiler error

4.

runtim error

10.

Predict the output of following Java program

class Test {
  int i;
}
class Main {
  public static void main(String args[]) {
      Test t = new Test();
      System.out.println(t.i);
   }
}
1.
garbage value
 
2.
0
 
3.

compiler error

4.

runtime error

Worksheets by UrbanPro

A little About Us

Our worksheets are designed to help students explore various topics, practice skills and enrich their subject knowledge, to improve their academic performance. Designed by Experts who have extensive experience and expertise in teaching a subject, these worksheets will improve your child's problem-solving skills and subject knowledge in a fun and interactive manner.
Check out our free customized worksheets across school boards, grades, subjects and levels of subject knowledge. You can download, print and share these worksheets with anyone, anywhere, anytime!

Get a custom worksheet to practice!

Select your topic & see the magic.

subject

Select a subject*

Core Java Hibernate J2EE JSP JSP (Java Server Pages) Servlet Spring Struts Struts Web services

Please select another category

Select Chapter(s)

Chapters & Subtopics

Advanced»

Select type of questions

Select the length of worksheet

Questions (5 to 100)

No of questions have to be between 5 to 100

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 25 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 6.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more