You are on page 1of 4

Which package is implicitly imported?

Koji je paket implicitno uvezen?

java.lang

Which two are valid import statements of the Scanner class?

Koje dvije su valjane izjave za uvoz klase Scanner?

import java.util.*;

import java.util.Scanner;

The import statement consists of two parts.

import package.className;

One is the package name and the other is the classname.

Jedan je naziv paketa, a drugi naziv klase.

True

Which is a risk of using fully qualified class names when importing?

Koji je rizik korištenja potpuno kvalificiranih naziva klasa prilikom uvoza?

Code readability is reduced.

Which of the following wild card character is used to import all the classes in a particular package?

Koji se od sljedećih zamjenskih znakova koristi za uvoz svih klasa u određenom paketu?

Which statement is true about packages?

Koja je tvrdnja točna za pakete?

A package contains a group of related classes.

The classes of the Java class library are organized into packages.

Klase Java biblioteke klasa organizirane su u pakete.

True

Which of the following two operations are appropriate for the main method?

Koje su od sljedeće dvije operacije prikladne za glavnu metodu?

Calling an instance object’s field and methods.

Creating instances of objects

Methods allow all instance of a class to share same behaviors.

Metode dopuštaju svim instancama klase da dijele isto ponašanje.

True
Which of the following are the arguments in the following method?
Koji su od sljedećih argumenata u sljedećoj metodi?
Employee emp = new Employee();
emp.calculateSalary(100000, 3.2, 15);

100000, 3.2, 15

Which is a valid way of calling the testMethod in the TestClass? Assume a testInstance has been
created.
Koji je valjan način pozivanja testMethoda u TestClass? Pretpostavimo da je stvorena testna
instanca.public void testMethod(int x, double y){
   System.out.println(x/y);
}

testInstance.testMethod(10, 3.5);

An argument is a value that's passed during a method call

Argument je vrijednost koja se prosljeđuje tijekom poziva metode

True

Which of the following scenarios would be ideal for writing a method?

Koji bi od sljedećih scenarija bio idealan za pisanje metode?

When you don’t want to repeat similar lines of code to describe an object’s behavior.

Once an object is instantiated, how might its fields and methods be accessed in Java?

Kada se objekt instancira, kako se njegovim poljima i metodama može pristupiti u Javi?

Using the dot(.) operator

You’re designing banking software and need to store 10000 customer accounts with information on
the accountholder’s name, balance, and interest rate. The best approach is store 30000 separate
variables in the main method.

Dizajnirate softver za bankarstvo i trebate pohraniti 10 000 korisničkih računa s informacijama o


imenu vlasnika računa, stanju i kamatnoj stopi. Najbolji pristup je pohraniti 30000 zasebnih varijabli u
glavnu metodu.

False

void type methods don’t return any values

metode tipa void ne vraćaju nikakve vrijednosti

True

In Java, methods usually hold the properties of an object.

U Javi metode obično drže svojstva objekta.

False
Which of the following statements are true?

Koje su od sljedećih tvrdnji istinite?

Parameter values can be used within the method code block.

Methods can be written with any number of parameters.

Given the import statement:

import java.awt.font.TextLayout;

which is the package name?

koji je naziv paketa?

Java.awt.front

The JFrame and JOptionPane classes are in the javax.swing package. Which two will import those
classes?

Klase JFrame i JOptionPane nalaze se u paketu javax.swing. Koje će dvije uvesti te klase?

import javax.swing.JOptionPane;

import javax.swing.JFrame;

import javax.swing.*;

Import statements are placed above the class definition.

Naredbe o uvozu nalaze se iznad definicije klase.

True

Object instantiation is done using what keyword?

Kojom se ključnom riječi vrši instanciranje objekta?

new

You might also like