Determine If an Object is an Array in Java

Anvi Jain
Updated on 29-Jun-2020 06:38:56

6K+ Views

In order to determine if an object is an Object is an array in Java, we use the isArray() and getClass() methods.The isArray() method checks whether the passed argument is an array. It returns a boolean value, either true or falseSyntax - The isArray() method has the following syntax -Array.isArray(obj)The getClass() method method returns the runtime class of an object. The getClass() method is a part of the java.lang.Object class.Declaration − The java.lang.Object.getClass() method is declared as follows −public final Class getClass()The getClass() method acts as the intermediate method which returns an runtime class of the object, which enables the terminal ... Read More

Format Percentage with MessageFormat Class in Java

Smita Kapse
Updated on 29-Jun-2020 06:16:08

262 Views

To format message with percentage fillers in Java, we use the MessageFormat class. The MessageFormat class gives us a way to produce concatenated messages which are not dependent on the language. The MessageFormat class extends the Serializable and Cloneable interfaces.Declaration - The java.text.MessageFormat class is declared as follows −public class MessageFormat extends FormatThe  MessageFormat.format(pattern, params) method formats the message and fills in the missing parts using the objects in the params array matching up the argument numbers and the array indices.The format method has two arguments, a pattern and an array of arguments. The pattern contains placeholder in {} curly ... Read More

Generate Random Boolean in Java

George John
Updated on 29-Jun-2020 06:14:19

15K+ Views

In order to generate Random boolean in Java, we use the nextBoolean() method of the java.util.Random class. This returns the next random boolean value from the random generator sequence.Declaration −The java.util.Random.nextBoolean() method is declared as follows −public boolean nextBoolean()Let us see a program to generate random boolean in Java −Example Live Demoimport java.util.Random; public class Example {    public static void main(String[] args) {       Random rd = new Random(); // creating Random object       System.out.println(rd.nextBoolean()); // displaying a random boolean    } }OutputtrueNote − The output might vary on Online Compilers.

Generate Random Float Type Number in Java

Ankith Reddy
Updated on 29-Jun-2020 06:11:10

4K+ Views

In order to generate Random float type numbers in Java, we use the nextFloat() method of the java.util.Random class. This returns the next random float value between 0.0 (inclusive) and 1.0 (exclusive) from the random generator sequence.Declaration −The java.util.Random.nextFloat() method is declared as follows −public float nextFloat()Let us see a program to generate random float type numbers in Java.Example Live Demoimport java.util.Random; public class Example {    public static void main(String[] args) {       Random rd = new Random(); // creating Random object       System.out.println(rd.nextFloat()); // displaying a random float value between 0.0 and 1.0    } ... Read More

Registers Used in 8259

Chandu yadav
Updated on 29-Jun-2020 06:07:59

3K+ Views

The 8259 is a specialized I/O port chip. It is never used in the interfacing of I/O devices but is only used for controlling the interrupts in a microcomputer.8259 consists of A0 as the only address input pin. Hence for a microprocessor, only two addresses are possible for the 8259 ports. The two ports can be termed as low port and high port.The processor selects the low port when A0 = 0The processor selects the high port when A0 = 1The processor issues some words termed as command words to these ports so as to configure the 8259 better. There are ... Read More

Register Indirect Addressing Mode in 8085 Microprocessor

Ankith Reddy
Updated on 29-Jun-2020 06:01:50

3K+ Views

In this mode, the data is transferred from one register to another by using the address pointed by the register. Register indirect addressing mode also used to call as indirect addressing mode. For example MOV A, M: means data is transferred from the memory address pointed by the register pair HLto the register A.MOV E, MIt occupies only 1-Byte in memory. MOV E, M is an example instruction of this type. It is a 1-Byte instruction. Suppose E register content is DBH, H register content is 40H, and L register content is 50H. Letus say location 4050H has the data ... Read More

Implied Addressing Mode in 8085 Microprocessor

George John
Updated on 29-Jun-2020 06:01:03

2K+ Views

In 8085 Instruction set, there is one mnemonic XCHG, which stands for eXCHanGe. This is an instruction to exchange contents of HL register pair with DE register pair. This instruction uses implied addressing mode. In the instruction, we don’t mention as “XCHG HL, DE”. It is implied that it will deal with HL and DEregister pairs. So we write only XCHG as mnemonic. That’s why it is called an implied addressing mode. As it is 1-Byte instruction, so It occupies only 1-Byte in the memory. After execution of this instruction, the content between H and D registers and L and ... Read More

Overview of the Working of 8259

Arjun Thakur
Updated on 29-Jun-2020 05:58:29

2K+ Views

The interrupt requests are accepted by 8259 from many interrupting devices IR0 to IR7  pins. After that, it identifies the highest priority interrupt request from those inputs that are already active. To configure the 8259 for fixed priority mode of operation, among them IR0 has the highest and IR7 has the lowest priority. If the inputs IR2, IR4, and IR6 are active, thenIR2 has the highest priority interrupt request among the active requests than the other. The details of the interrupt requests those are active are stored in the Interrupt Request Register (IRR).By loading the Interrupt Mask Register (IMR), it ... Read More

Architecture of 8259

Ankith Reddy
Updated on 29-Jun-2020 05:53:02

5K+ Views

8259 Microprocessor is architected in a unique style. It can program by means of some interrupts conditions by means of level or interrupt level often called edge-triggered interrupt level. Masking is done to individual interrupt bits. As the number of 8259 increases interrupt pins up to 64 can be obtained. There are 3 registers 8259 contains along with one priority resolver(PR). They are as follows −Interrupt Request Register(IIR)  − It stores the bits who requests the interrupt.Interrupt service register(ISR) − It stores the currently interrupt levels.Interrupt Mask Register(IMR)  − Stores the interrupt levels to be masked.PriorityResolver(PR)  − Set the priority of ... Read More

Understanding the Pins of 8259

George John
Updated on 29-Jun-2020 05:52:04

6K+ Views

Intel 8259 is designed as a 28-pin-programmable IC available as a package named DIP (Dual inline package). Its physical and functional pin diagrams are indicated below.PIN NameDescription and PurposesVcc and GndIt is the Power supply and ground pins. +5V power supply isused in this chip.D7-0For communication with the processor, there are Eight bi-directional data pins.RD*It is active low-input pin activated by the processor to read the information status from the 8259.WR*It is an active low-input pin which is activated by the processor to write the control information to  8259.CS*For selecting the chip it is used an active low input pin.A0An ... Read More

Advertisements