| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Transition from Turing to Java

Page history last edited by Steve Sweeney 9 years, 1 month ago

 

Basic Output:
put "Hello World!"
System.out.println("Hello World");

Program Framework:

  • Turing has no program framework. You type your commands in the Turing editor and Run the program.
  • Java programs are complicated by the fact that they could potentially run on many systems with many types of hardware. While the framework can be confusing, it is necessary so that Java can be as versatile and powerful as it is.
    • The Java framework is marked in blue bold.
    • The parts you should change as a new Java programmer are marked in red bold.
    • See this note on your First Java Program.
put "Hello World!"

class HelloWorld

{

   public static void main (String[] args)

   {

      System.out.println("Hello World");

   }

}

Variables & Assignment Operator:  

var age : int

var bankBalance : real

var name : string

 

age := 16

bankBalance := 103.24

name := "Fred Flintstone"

int age;

double bankBalance;

String name;

 

age = 16

bankBalance = 103.24

name = "Fred Flintstone"

   
   

 

 

 

Comments (0)

You don't have permission to comment on this page.