What is the Java bytecode, and what is the extension of Java bytecode file? Which software is needed to run Java bytecode?
[3 marks]Describe syntax errors (compile errors), runtime errors, and logic errors by giving suitable examples?
[4 marks]Answer in brief (within 50 words): I. Justify Java enables high performance. II. Differentiate between while and do while loop? III. How many times is the println statement executed? for (int i = 0; i < 10; i++) for (int j = 0; j < i; j++) System.out.println(i * j); IV. If the value of variable x is 1 then what will be returned by the following expression: x % 2 = = 0
[7 marks]What is the use of this keyword? How it is different from super keyword?
[3 marks](i) Given that Thing is a class, how many objects and how many reference variables are created by the following code? Thing item, stuff; item = new Thing(); Thing entity = new Thing(); (ii) Examine following code. Write and justify output. public class MyClass { public static void main(String[] args) { Cc = new C(); System.out.println(c.max(12, 29)); } } class A { int max(int x, int y) { if (x>y) return x; else return y; } } class Bextends A{ int max(int x, int y) { return super.max(y, x) - 10; } } class Cextends B { int max(int x, int y) { return super.max(x+10, y+2); } }
[4 marks]Write a program that defines class named StopWatch. The class contains: • Private data fields startTime and endTime with getter methods.1 • no-arg constructor that initializes startTime with the current time. • Amethod named start() that resets the startTime to the current time. • Amethod named stop() that sets the endTime to the current time. • Amethod named getElapsedTime() that returns the elapsed time for the stopwatch in milliseconds. • Declare object of StopWatch to demonstrate stop watch. Hint: Use System.currentTimeMillis() to get current time in milliseconds.
[7 marks]Create a class called Employee that includes: I. Three instance variables— id (type String), name (type String) and monthly_salary (double). II. Adefault constructor that initializes the three instance variables. III. Asetter and a getter method for each instance variable (for example for id variable void setId(String id), String getId( )). IV. displayEmployee() method for displaying employee details. Write a driver class named EmployeeTest that demonstrates class Employee’s capabilities. Create two Employee objects and display each object’s yearly salary. Then give each Employee a 10% raise and display each Employee’s yearly salary again.
[7 marks]Differentiate between checked and unchecked exception?
[3 marks]Exemplify throw and throws clause of exception handling?
[4 marks]Demonstrate use of try catch block by catching ArithmeticExceptions and InputMismatchExceptions?
[7 marks]Describe thread life cycle with block diagram?
[3 marks]Differentiate between Thread class and Runnable interface for implementing Threads?
[4 marks]Write a program to make calculator that accepts input from commandline? Use java’s exception handling mechanism to handle abnormal situation?
[7 marks]Define Queue interface of java collection classes?
[3 marks]Explain types of polymorphism?
[4 marks]What are the differences between ArrayList and LinkedList? Demonstrates use of ArrayList with example?
[7 marks]Define Object Serialization?
[3 marks]What are the differences between text I/Oand binary I/O?
[4 marks]Describe and demonstrate Binary I/Oclasses of java?
[7 marks]Answer in one line:
[3 marks]Write the name of package in which all collection classes and interface are grouped. (ii) Write the name of collection interface or abstract class which store and process object in a first-in, first-out fashion. (iii) Write the name of method that checks whether the collection contains the specified element.
[ marks]List JavaFX UI controls?
[4 marks]What do you understand by event source and event object? Explain how to register an event handler object and how to implement a handler interface?
[7 marks]Enlist various Layout panes available in JavaFX?
[3 marks]Discuss JavaFX benefits?
[4 marks]Illustrate basic structure of JavaFX program?
[7 marks]