Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Primitive Types | Basic Types and Operations
Java Basics

book
Challenge: Primitive Types

Taak

Swipe to start coding

Fill in the blanks with the appropriate primitive data types.

  1. The first blank needs to hold a whole number.
  2. The second blank should store a decimal number.
  3. The third blank type should have a range of numbers from -32,768 to 32,767.
  4. In the fourth blank, you need to store a single character.
  5. The fifth blank should hold a boolean value (true or false).
  6. The sixth blank stores a floating-point number with less precision than a double.

Oplossing

java

solution

package com.example;

public class Main {
public static void main(String[] args) {
byte myNum = 14;
double myFractional = 14.928;
short myBiggerNum = -710;
char myLetter = 'B';
boolean myBool = true;
float myWho = 1.74f;
System.out.println("It's working, well done!");
}
}
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 2
package com.example;

public class Main {
public static void main(String[] args) {
___ myNum = 14;
___ myFractional = 14.928;
___ myBiggerNum = -710;
___ myLetter = 'B';
___ myBool = true;
___ myWho = 1.74f;
System.out.println("It's working, well done!");
}
}

Vraag AI

expand
ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt