73 lines
1.5 KiB
TeX
73 lines
1.5 KiB
TeX
|
% enum Color{
|
||
|
% RED("#FF0000"), BLUE("#0000FF"), GREEN("#00FF00");
|
||
|
% private String code;
|
||
|
% Color(String code){
|
||
|
% this.code = code;
|
||
|
% }
|
||
|
% public String getCode(){ return code;}
|
||
|
% }
|
||
|
|
||
|
%public class Main{
|
||
|
% public static void main(String[] args) {
|
||
|
% System.out.println(Color.RED.getCode());
|
||
|
% System.out.println(Color.GREEN.getCode());
|
||
|
% }
|
||
|
%}
|
||
|
|
||
|
|
||
|
% package ru.gb.jcore;
|
||
|
|
||
|
% public class Orange {
|
||
|
|
||
|
% public void squeezeJuice(){
|
||
|
% System.out.println("Squeeze juice ...");
|
||
|
% }
|
||
|
|
||
|
% class Juice{
|
||
|
|
||
|
% public void flow(){
|
||
|
% System.out.println("Juice dripped ...");
|
||
|
% }
|
||
|
% }
|
||
|
% }
|
||
|
|
||
|
% package ru.gb.jcore;
|
||
|
|
||
|
% public class Main {
|
||
|
|
||
|
% public static void main(String[] args) {
|
||
|
% Orange orange = new Orange();
|
||
|
% Orange.Juice juice = orange.new Juice();
|
||
|
% orange.squeezeJuice();
|
||
|
% juice.flow();
|
||
|
% }
|
||
|
% }
|
||
|
%///////////////////////////////
|
||
|
% public class Orange {
|
||
|
|
||
|
% private Juice juice;
|
||
|
|
||
|
% public Orange(){
|
||
|
% this.juice = new Juice();
|
||
|
% }
|
||
|
|
||
|
% public void squeezeJuice(){
|
||
|
% System.out.println("Squeeze juice ...");
|
||
|
% juice.flow();
|
||
|
% }
|
||
|
|
||
|
% private class Juice{
|
||
|
|
||
|
% public void flow(){
|
||
|
% System.out.println("Juice dripped ...");
|
||
|
% }
|
||
|
% }
|
||
|
% }
|
||
|
% public class Main {
|
||
|
|
||
|
% public static void main(String[] args) {
|
||
|
% Orange orange = new Orange();
|
||
|
% orange.squeezeJuice();
|
||
|
% }
|
||
|
% }
|