Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package day3_classes;
- import java.util.Scanner;
- /**
- *
- * @author sao_7
- */
- public class Example {
- //private, public
- //static
- private int maluSkaits;
- public Example() {
- maluSkaits = 0;
- }
- public static void staticExample() {
- System.out.println("Static");
- }
- public void nonStaticExample() {
- System.out.println("Non static");
- }
- public void whileExample() {
- Scanner sc = new Scanner(System.in);
- String exit = "";
- while (!exit.equals("yes")) {
- System.out.println("Izvade!");
- exit = sc.nextLine();
- exit = exit.toLowerCase();
- }
- }
- //Uztaisam klasi ar nosaukumu tasks
- //statisku metodi, kas izvada
- //*
- //**
- //***
- //****
- //***
- //**
- //*
- public static void stars() {
- String output = "";
- for (int i = 0; i < 4; i++) {
- output = output + "*";
- System.out.println(output);
- }
- //Uztaisat lauku (int) ar nosaukumu a
- //konstruktora iedodat vertibu 0
- //metodi ar parametru maina vertibu mainigajam a
- //FOR NOW IGNORE
- //Uztaisit kalkulatoru
- //Matematiskas darbibas jauna klase
- //vertibas mes padodam ieksa ar parametriem
- //un rezultatu atgriezam return
- //Main metode Day3 klasē- izmantojam while ciklu
- //lai uztaisam menu
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement