This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package company; | |
public class Order extends Product { | |
private int toys; | |
private int iceCream; | |
Order(int toys, int iceCream){ | |
this.toys = toys; | |
this.iceCream = iceCream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package company; | |
public class Boss implements Employee { | |
private int n = 15; | |
@Override | |
public void sayWhoAreYou() { | |
System.out.println("I am Boss!"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package velocity; | |
public class Car extends Movement { | |
Car(String name){ | |
this.name = name; | |
} | |
public void getInfoMov(){ | |
goGoGo(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Circle { | |
private double radius; | |
public void setRadius(double radius) { | |
if(radius > 0) | |
this.radius = radius; | |
else | |
System.out.println("Error Radius of Circle"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.Random; | |
public class SortRandomArray { | |
public static void main(String[] args){ | |
int line = 30; | |
int array [] = new int[line]; | |
int i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
public class RandomArray { | |
public static void main(String[] args){ | |
int height = 4; | |
int line = 5; | |
int array [][] = new int[height][line]; | |
int i,j = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Rhombus { | |
public static void main(String[] args){ | |
int sizeFig = 9; //Write your own size(3,5,7,9...) | |
for(int i=0; i < sizeFig; i++) { | |
for(int k = 0; k < sizeFig; k++) { | |
if( k == sizeFig - (sizeFig/2) - i - 1 || k == (sizeFig/2) + i || | |
(i > (sizeFig/2) - 1 && k == sizeFig + (sizeFig/2) - i - 1 ) || | |
(i > (sizeFig/2) - 1 && k == (sizeFig/2) - sizeFig + i + 1) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Trigon { | |
public static void main(String[] args){ | |
int sizeFig = 11; //Write your own size(3,5,7,9...) | |
for(int i=0; i < sizeFig; i++) { | |
for(int k = 0; k < sizeFig; k++) { | |
if( k == sizeFig - (sizeFig/2) - i - 1 || k == (sizeFig/2) + i || i == (sizeFig/2) ) | |
System.out.print("*"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Trigon90 { | |
public static void main(String[] args){ | |
int sizeFig = 9; //Write your own size | |
for(int i=0; i < sizeFig; i++) { | |
for(int k = 0; k < sizeFig; k++) { | |
if( k == sizeFig - 1 || i == sizeFig - 1 || k == sizeFig - 1 - i) | |
System.out.print("* "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SquareX { | |
public static void main(String[] args){ | |
int sizeFig = 9; //Write your own size | |
for(int i=0; i < sizeFig; i++) { | |
for(int k = 0; k < sizeFig; k++) { | |
if( k == 0 || k == sizeFig - 1 || i == 0 || i == sizeFig - 1 | |
|| k == i || k == sizeFig - 1 - i) |