public class TestIOApp {
% C0 x0 f: v* D; i k6 _% b public static void main(String args[])
5 M5 c X5 Z, P throw IOException {7 U/ s" C# `% q1 W
RandomAccessFile file = new4 t f. I; N1 N9 ?
RandomAccessFile(“test.txt”, “rw”);
' K4 E: d8 |: T( q file.writeBoolean(true);- ?/ y& a1 O% J' E$ j
file.writeInt(123456);% ?+ w# D2 ^& @! r! \
file.writeInt(7890);6 A% g' t: t% b& O; C& n+ R
file.writeLong(10000000);7 y1 |% [8 ?) ~
file.writeInt(777);% k! T$ ` L" C7 X$ z
file.writeFloat(.0001f);
/ w5 B8 c& L( i. V( y file.seek(5);
' T( M& f5 A! I: y( a( N System.out.println(file.readInt());
+ Y3 a4 t& j& u( g5 L9 m file.close();
) ^# ?7 Q5 E, Y d }/ K: k: p: p) z+ D3 d0 L8 }- F
}
+ d& h- V& ~- ^) N4 a A 1234561 e) V1 a; X( |2 M
B 7890
& d; I. D8 y& `' d; V% f F C 10000000
; e6 e" S/ w& y D 777
! l8 j3 R( A& b" P Q24 Given a component, comp, and a container, cont, that is organized according to a BorderLayout, which of the following should be used to add comp to the top of the container.- C$ U& Q# a. h* U1 V
A addTop(cont, comp);
2 R$ r1 H4 _% c% Q B comp.add(“North”, cont);
* d8 [8 q( n& _ C cont.add(“North”, comp);
! `# ?/ t/ V6 v) `2 _: u D cont.addTop(comp);
4 [* y( b% B. Y; }) M Q022 D
1 n7 ^' r2 j$ u5 Y Q023 B9 p; j V0 M/ Q% Z0 V
Q024 C |