• Keine Ergebnisse gefunden

Exercise2Typing Exercise1StooJasExtension PracticeSheet4:FortgeschritteneAspekteobjektorientierterProgrammierung(SS2008)

N/A
N/A
Protected

Academic year: 2022

Aktie "Exercise2Typing Exercise1StooJasExtension PracticeSheet4:FortgeschritteneAspekteobjektorientierterProgrammierung(SS2008)"

Copied!
1
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Prof. Dr. A. Poetzsch-Heffter Dipl.-Inform. Markus Reitz

Technische Universität Kaiserslautern Fachbereich Informatik AG Softwaretechnik

Practice Sheet 4: Fortgeschrittene Aspekte objektorientierter Programmierung (SS 2008)

Date of Issue: 29. April 2008 Deadline: 05. Mai 2008 (until 10 a.m. as PDF via E-Mail)

Exercise 1 StooJas Extension

The Java subsetStooJasthat was presented in the lecture neither provides static methods nor static variables.

a) Extend the syntax as well as the semantics (static & dynamic) ofStooJasto support static methods. Please give a detailed explanation for the necessary adjustments.

b) Extend the syntax as well as the semantics (static & dynamic) ofStooJasto support static variables. Please give a detailed explanation for the necessary adjustments.

Exercise 2 Typing

a) Is the following code fragment a syntactical correct Java fragment? Please justify your answer.

. . .

i f ( c o n d i t i o n ) a=7 ; e l s e

a=a s L i s t ( 1 7 0 1 , 4 7 1 1 ) ; i f ( c o n d i t i o n )

a=a+7 ; e l s e

a . add ( 4 2 ) ;

S y s t e m . o u t . p r i n t l n ( a ) ; . . .

b) Is it possible to adapt the fragment just byaddingstatements, so a Java compiler is able to create the corresponding bytecode file? Please justify your answer.

c) Transform the fragment to a working JavaScript fragment, so the ouput is either14or1701,4711,42depending on the value of variablecondition.

Referenzen

ÄHNLICHE DOKUMENTE

Die Frage der Verwertung der mineralischen Fraktion wird davon abhängen, inwieweit es gelingen kann sie unter wirtschaftlichen Bedingungen von Metallen wie Blei, Chrom,

Monitoring the cellular wet weight and total protein proved that the bacterial growth rate is not depending on the production of fusion enzymes, how- ever activity assays

As a filter in E 0 converges to the origin in the strong topology if and only if it converges to the origin uniformly on every bounded subset of E (see Proposition 3.2.2), the

He deserves to be praised by a grateful present and posterity as the man who first liberated mankind from immaturity (as far as government is concerned), and who left all men free

The greatest trigger has been Russia’s unpredictable, aggressive behaviour in Ukraine in the past year. Lack of trust in a long- standing economic partner and concerns about relying

According to Alejandro Quiroz Flores, the modern state holds two comparative advantages over other forms of political organization — it is far better at directing large and

The complimentary operation of the instrument as an underfocussed medium- resolution shadow microscope [3] has recently been accompanied by the introduction of such techniques

Article 1(2) of the Convention defined terrorism as “any act of violence or threat thereof notwithstanding its motives or intentions perpetrated to carry out