You are on page 1of 4

The Scanner class accepts input in which form?

U kojem obliku klasa Scanner prihvaća unos?

Tokens

System.in readies Scanner to collect input from the console.

System.in priprema skener za prikupljanje podataka s konzole.

True

The Scanner class considers space as the default delimiter while reading the input.

Klasa Scanner razmatra prostor kao zadani graničnik dok čita unos.

True

Which two statements are true about type casting?

Koje su dvije tvrdnje točne o ubacivanju tipova?

Type casting changes the type of the value stored.

Type casting lowers the range of possible values.

A short data type can be promoted to which of the following types?

Kratka vrsta podataka može se unaprijediti u koju od sljedećih vrsta?

double

int

long

What is parsing?

Što je raščlanjivanje?

Converting text to numeric data

The Java compiler automatically promotes byte, short, and chars data type values to int data type.

Java prevodilac automatski promiče vrijednosti tipa podataka bajtova, kratkih i znakovnih u int tip podataka.

True

Which is a valid way to parse a String as an int?

Koji je valjan način raščlanjivanja niza kao int?

int intVar1 = Integer.parseInt("100")

What is the correct way to cast a long to an int?

Koji je ispravan način baciti long na int?

int longToInt = (int)20L

An Object cannot have String objects as properties.

Objekt ne može imati String objekte kao svojstva.

False
Given the expression:

String message = ”Hello World”;

Which is the String Literal?

Koji je string literal?

Hello World

char is the primitive textual data type in Java.

char je primitivni tekstualni tip podataka u Javi.

True

In Java, char is a primitive data type, while String is an object data type.

U Javi, char je primitivni tip podataka, dok je String objektni tip podataka.

True

A String can be created by combining multiple String Literals.

String se može stvoriti kombiniranjem više string literala.

True

Double quotes may be used with char literal values.

Dvostruki navodniki mogu se koristiti s vrijednostima literalnih znakova.

False

These two code fragments perform the same task.


Ova dva fragmenta koda obavljaju isti zadatak.
// Fragment 1
String inputString = JOptionPane.showInputDialog("??");
int input = Integer.parseInt(inputString);
input++;

// Fragment 2
int input = Integer.parseInt(JOptionPane.showInputDialog("??")) + 1;

True

The print() method prints to the console and automatically creates a line.

Metoda print() ispisuje se na konzolu i automatski stvara liniju.

False

Which two statements are true about String concatenation.

Koje su dvije tvrdnje točne o povezivanju nizova.

Strings can be combined using the ‘+’ operator

String concatenation can be done with String variables and String Literals
A character preceded by backslash is called an escape sequence

Znak kojem prethodi obrnuta kosa crta naziva se izlazni niz

True

Which two statements are correct about the usage of an underscore?

Koje su dvije tvrdnje točne o upotrebi podvlake?

Underscores help make large numbers more readable.

Underscores do not affect the value of the variable.

Which exception occurs because a String cannot be parsed as an int?

Koja se iznimka događa jer se String ne može raščlaniti kao int?

NumberFormatException

When the result of an expression is assigned to a temporary memory location, what is the size of
memory allocated?

Kada je rezultat izraza dodijeljen privremenoj memorijskoj lokaciji, koja je veličina dodijeljene memorije?

The size of the largest data type used in the expression

Automatic promotion from smaller data type to a larger data type is not allowed in Java.

Automatsko promicanje s manje vrste podataka na veću vrstu podataka nije dopušteno u Javi.

False

Which two statements are true about the Scanner class

Koje su dvije tvrdnje točne za klasu Scanner

A Scanner’s delimiter can be changed

A Scanner object opens a stream for collecting input.

Which two statements compile

Koje dvije izjave sastavljaju

String name = “J”;

String name = “Java”;

Which two statements compile

Koje dvije izjave sastavljaju

char size = ’m’;

String size = “M”;

Which is the correct declaration for a char data type?


Koja je točna deklaracija za tip podataka char?
char size = ’M’;
It's best-practice to close the Scanner stream when finished

Najbolja je praksa zatvoriti stream Scanner kada završite

True

char is the primitiTipovi podataka Char ne mogu rukovati više znakova.

True

A double with the value of 20.5 is cast to an int. What is the value of the int?

Dvostruka vrijednost od 20.5 baca se na int. Kolika je vrijednost int?

20

You write a statement that assigns a value to a String variable as shown below.

String input = ”This is Java Program”;

This way of assigning values to variables is known as hard-coding.

Ovaj način dodjele vrijednosti varijablama poznat je kao tvrdo kodiranje.

True

You might also like