Beruflich Dokumente
Kultur Dokumente
1) Sort and display a list of 10 numbers in ascending order. Use either selection sort or bubble sort
for this.
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights
ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time.
Each flight has a unique 3 digit numeric identifier.
Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is
added to the waitlist, the list of flights waiting to take-off must be displayed.
When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist.
Each time a flight takes-off, the list of flights waiting to take-off must be displayed.
Sequence of take-off is the sequence of addition to the waitlist.
Java
Introduction and Basics
1. Why the code below does not compile?
public class A{
public static void main(String str[]){
String d = "\u000d";
System.out.println(d);
}}
2. The code above has been modified. Now will it compile?
public class A{
public static void main(String str[]){
// String d = "\u000d";
String d = "\u0032";
System.out.println(d);
}}
3. Why does this code print 0?
public class A{
public static void main(String str[]){
byte b= (byte) 256;
System.out.println(b);
}}
4. Why line 2 works and line 3 gives compilation error?
public class A{
public static void main(String str[]){
byte b=1;
b++; //line 2
b=b+1; //line 3
}}
5.
package my;
import my.*;
package my.*;
package my.ex;
import my.ex.*;
import my.ex.one;
package my.ex.one;
package my.ex.one.Dog;
7)
The ctrl, alt and delete combination that reboots the computer if it is held down long enough is
also known as the three finger salute in a computer. This sequence was coded by David Bradley
back in 1980 and it took him about five minutes !