Oop I - Lab Manual
Oop I - Lab Manual
NAME: _______________________________________________
YEAR: ________________________________________________
CERTIFICATE
Date of Submission:-
OUTPUT:-
OUTPUT:-
}
if(count == 1){
System.out.println("Vow
el");
}
else {
System.out.println("Consona
nt");
}
s.close();
}
}
OUTPUT:-
int temp;
for(int i = 0, j = list.length - 1; i<list.length/2; i+ +, j--)
{
temp =
list[i];
list[i] =
list[j]
list[j] = temp;
}
}
}
OUTPUT:-
1
2
3
4
5
6
7
8
9
10
char ch =
alphabet.charAt((int)(Math.random() * 10));
System.out.println(ch);
}
OUTPUT:-
The Plate number is: CED5032
The Plate number is: CDI1441
PRACTICAL -6
Integer111] a = new
Integer[3][3]; int value = 0;
Scanner input = new Scanner(System.in);
System.out.println("Enter the elements in 3.3
matrix"); for (int i = 0; i < a.length; i++)
{
value =
input.nextInt();
a[i][j] = value;
}
}
E min = list[0][0];
min = element;
}
}
}
return min;
}
}
OUTPUT:-
@Override
public void start(Stage
primaryStage) { Circle circle
new Circle(50,50,20);
circle.setFill(Color,RED);
circle.setStroke(Color.BLACK);
Text text = new Text(20,20,''Use arrow keys to move
the circle"); Group root = new Group(text,circle);
Scene scene=new Scene(root,400,200);
case
DOWN:circle.setCenterY(circle.getCenterY0
+10); break;
case
UP:circle.setCenterY(circle.getCenterY0-
10); break;
case
LEFT:circle.setCenterX(circle.getCenterX0
} -10); break;
}) case
;
RIGHT:circle.setCenterX(circle,geteenterX0
+10); break;
primaryStage.setScene(scene);
primaryStage.setTitle("Move Circle Using
Arrow Keys"); primaryStage.show();
}
text.setFill(Color.RED);
}
});
blue.setOnAction(e
-> {
if(blue.isSelected()
)
{
text.setFill(Color.BLUE);
}
});
green.setOnAction(e- >
{
if(green.isSelecte
d())
{
text.setFill(Color.GREEN);
}
});
Scene scene =new
Scene(borderPane,400,200);
primaryStage.setScene(scene);
primaryStage.setTitle("Arrow Button and Color Radio
Button Demo"); primaryStage.show();
}
public static void main(String[]
args) { launch(args);
}
}
OUTPUT:-
PRACTICAL -9
System.out.println();
System.out.println("Queue
2: "); while (q2.size() > 0)
{
OUTPUT:-
Queue1: 20 30
10
Queue2: 20 30
10
PRACTICAL -10
Step 2: Write a Java program that reads the file name using command line
argument and displays all the nonduplicate words in descending order.
import java.io.*;
import
java.util.*; class
ReadFileWords
{
}
ArrayList list =new ArrayList(); //Declaring ArrayList to store
words of file StringTokenizer st = new
StringTokenizer(buffer.toString().toLowerCase());
while(st.hasMoreTokens()) //creating a list of words read
from file
{
String s =
st.nextToken.();
list.add(s);
}
Output: