4 Replies - 155 Views - Last Post: 21 June 2020 - 07:23 AM Rate Topic: -----

#1 hellswindstaff   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 37
  • Joined: 27-February 12

Quick question about runtime

Posted 21 June 2020 - 01:24 AM

Assuming everything compiles correctly. Does a compiler execute all lines of code in a program simultaneously at runtime?
Is This A Good Question/Topic? 0
  • +

Replies To: Quick question about runtime

#2 g00se   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3698
  • View blog
  • Posts: 16,952
  • Joined: 20-September 08

Re: Quick question about runtime

Posted 21 June 2020 - 03:04 AM

Quote

Does a compiler execute all lines of code in a program simultaneously at runtime?

A compiler doesn't execute anything. A compiler turns source code into Java bytecode, which is then executed by the runtime and the bytecode instructions run in the order that they are presented
Was This Post Helpful? 1
  • +
  • -

#3 hellswindstaff   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 37
  • Joined: 27-February 12

Re: Quick question about runtime

Posted 21 June 2020 - 06:23 AM

View Postg00se, on 21 June 2020 - 03:04 AM, said:

Quote

Does a compiler execute all lines of code in a program simultaneously at runtime?

A compiler doesn't execute anything. A compiler turns source code into Java bytecode, which is then executed by the runtime and the bytecode instructions run in the order that they are presented

So line 1 is executed followed by line 2 then line 3, and etc?
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15724
  • View blog
  • Posts: 62,994
  • Joined: 12-June 08

Re: Quick question about runtime

Posted 21 June 2020 - 07:12 AM

Yes, java is a procedural (imperative) language.
Was This Post Helpful? 1
  • +
  • -

#5 NormR   User is online

  • D.I.C Lover
  • member icon

Reputation: 832
  • View blog
  • Posts: 6,392
  • Joined: 25-December 13

Re: Quick question about runtime

Posted 21 June 2020 - 07:23 AM

Quote

So line 1 is executed followed by line 2 then line 3, and etc?

Not quite. A program's execution usually starts with the first statement in the main method and flows from there.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1