Skip to content

mjc-school/stage0-module3-task3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tasks:

1) Basic variable initialization.

Create 3 int variables with names: first, second, third. Initialize them with values: 1, 10, 100. Make console outputs for all of them, each on new line. Implement the program inside of given code snippet:

public class BasicVariablesInitialization {
    public static void main(String[] args) {
         //write code here
    }
}

2) One-line variable declaration and initialization.

Declare 3 int variables within one statement and call them a, b, c (order must be followed). Initialize them in one statement with value "10". Print to console "c". Implement the program inside of given code snippet:

public class DeclaringVars {
   public static void main(String[] args) {
        //write code here 
   }
}

3) Reassigning references.

Declare another 3 variables: first, second, third (1,10,100). Make console output of 3 initial vars (first, second, third) each on new line. Initialize vars linkToFirst, linkToSecond, linkToThird with the variables first, second, third. Reassign (first, second, third) with the : 15, 6, 4. And write to console all the variables (in the order they were declared), each on a new line. Pay attention to results. Implement the program inside of given code snippet:

public class ReassigningValues {
   public static void main(String[] args) {
        //write code here 
   }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages