Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

/**
* Create a class and output "Hello Java!"
* Java code always starts in the main() method
*/
class MyClass {
/**
* SOLUTION
*/
public static void main(String args) {
/**
* Create a new Dog instance ...
* Make the dog size = 10
*/
class App {
public static void main(String[] args) {
/**
* SOLUTION
/**
* Create an array nums of integers ...
* The array must have the length = 3 ...
* First element nums[0] should display 100
*/
class App {
public static void main(String[] args) {
/**
/**
* Declare showInfo() method ...
* The method should display "Cooper is 3 age old" ...
* The method must have no return type
*/
class App {
public static void main(String[] args) {
/**
* Make a for-each loop and ...
* Output all names
*/
class LearningApp {
public static void main(String[] args) {
String[] names = {"John", "Marry", "Ana"};
/**
* Declare Number no as float 22.23 ...
* Use object's shortValue() method and ...
* Display no as 22
*/
class App {
public static void main(String[] args) {
/**
/**
* Define a string s1 = "1"
* Define a number n1 = 2
* Display the sum of s1 + n1 = 3
* (convert the string to number)
*/
class App {
public static void main(String[] args) {
<?php
/**
* Define $output on multiple $lines
* Use Herodoc syntax.
*
* output =
* She said "This is John's test"
* on multiple rows
*/
@minte9
minte9 / index.php
Last active April 14, 2021 08:19
Php / Basics / Integers / Decimal 2 Ocatal - https://www.minte9.com/php/basics-integers-13
<?php
/**
* Compose $m octal value using myFunc() recursively
* Use reminder and quontient values
*
* 97 (decimal) = 141 (octal)
* 97 % 8 => reminder 1
* 12 % 8 => reminder 4
* 1 % 8 => reminder 1
<?php
/**
* Define getMaxValue() method
* Use static syntax
*/
class MyClass {
const MAX_VALUE = 100;