0% found this document useful (0 votes)
9 views5 pages

Java Foundation Tutorial Questions

The document contains a set of tutorial questions related to Java programming, covering topics such as the history of Java, its features, keywords, and various programming concepts. Each question provides multiple-choice answers, testing knowledge on Java syntax, operations, and output of code snippets. The questions range from basic definitions to specific programming scenarios.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

Java Foundation Tutorial Questions

The document contains a set of tutorial questions related to Java programming, covering topics such as the history of Java, its features, keywords, and various programming concepts. Each question provides multiple-choice answers, testing knowledge on Java syntax, operations, and output of code snippets. The questions range from basic definitions to specific programming scenarios.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

CIT211 Java Foundation

Tutorial Questions

1. Java was first developed in ?


[A] 1990
[B] 1991
[C] 1993
[D] 1996

2. The old name of Java was ?


[A] J language
[B] oak
[C] oct
[D] None of above

3. Which of the following feature is not supported by java ?


[A] Multithreading
[B] Reflection
[C] Operator Overloading
[D] Garbage Collection

4. Which of the following is not keyword in java ?


[A] null
[B] import
[C] volatile
[D] package

5. What is the full form of JDK ?


[A] Java Data Kit
[B] Java Defination Kit
[C] Java Development Kit
[D] Java Design Kit

6. Which command is used to compile a java program ?


[A] javac
[B] java
[C] javad
[D] .javadoc

7. What is the full form of JVM


[A] Java Virtual Machine
[B] Java Variable Machine
[C] Java Virtual Mechanism
[D] Java Variable Mechanism
8. What is the full form of ADT ?
[A] Abstract Data Type
[B] Abstract Development tool
[C] Abstract Design Tool
[D] Advance Development Tool

9. The expected signature of the main method is public static void main(). What happens if we
make a mistake and forget to put the static keyword ?
[A] The JVM issues an error saying that main method should be declared static
[B] The compiler issues a warning saying that main method should be declared static and
adds it automatically
[C] The JVM successfully invokes the main method
[D] The JVM fails at runtime with NoSuchMethodError

10. What does the AWT stands for ?


[A] Abstract Windowing toolkit
[B] A web toolkit
[C] Application with types
[D] Absolutly wonderfull toolkit

11. Which of the following can be operands of arithmetic operators?


[A] Numeric
[B] Boolean
[C] Characters
[D] Both Boolean & Characters

12. What is the output of the program.


class operators {

public static void main(String args[])

int x = 8;

[Link](++x * 3 + "," + x);

}
[A] 24,8
[B] 24,9
[C] 27,8
[D] 27,9
13. What is the output of the program.
public class Test

public static void leftshift(int i, int j)

i <<= j;

public static void main(String args[])

int i = 4, j = 2;

leftshift(i, j);

[Link](i);

}
[A] 2
[B] 4
[C] 8
[D] 16
14. what is the output of the program ?
class Equals

public static void main(String [] args)

int x = 100;

double y = 100.1;

boolean b = (x = y);

[Link](b);

}
[A] true
[B] false
[C] Compilation fails
[D] An exception is thrown at run time
15. What is the output of the program ?
class Test

public static void main(String [] args)

int x=20;

String sup = (x < 15) ? "small" : (x < 22)? "tiny" : "huge";

[Link](sup);

}
[A] small
[B] tiny
[C] huge
[D] compilaton fails

16. Modulus operator, %, can be applied to which of these?


[A] Integers
[B] Floating – point numbers
[C] Both Integers and floating – point numbers
[D] None of the mentioned

17. Decrement operator, –, decreases value of variable by what number?


[A] 1
[B] 2
[C] 3
[D] 4

18. Which of these statements are incorrect?


[A] Assignment operators are more efficiently implemented by Java run-time system than
their equivalent long forms.
[B] Assignment operators run faster than their equivalent long forms
[C] Assignment operators can be used only with numeric and character data type
[D] None

19. What is the output of this program?


class increment {

public static void main(String args[])

int g = 3;

[Link](++g * 8);
}

}
[A] 25
[B] 24
[C] 32
[D] 33

20. Which of these is not a bit-wise operator?


[A] &
[B] &=
[C] |=
[D] <=

You might also like