Nancy Den has Published 290 Articles

Memory-mapped I/O in 8085 Microprocessor

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

8K+ Views

It is possible to address an I/O port as if it were a memory location. For example, let us say, the chip select pin of an I/O port chip is activated when address = FFF0H, IO/M* = 0, and RD* = 0. This is shown in the following fig.In this ... Read More

Java Program to parse a mathematical expression and operators

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

2K+ Views

At first, we have set the mathematical expressions:String one = "10+15*20-5/5"; String two = "3+5-6"; String three = "9+2*(6-3+7)";To parse mathematical expression, use Nashorn JavaScript in Java i.e. scripting. Nashorn invoke dynamics feature, introduced in Java 7 to improve performance.For scripting, use the ScriptEngineManager class for the engine:ScriptEngineManager scriptEngineManager = ... Read More

The add() method in Java Stream.Builder

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

569 Views

Use the add() method to insert elements in the Stream.Builder. The element to be added is a parameter for the add().The following is the syntax:default Stream.Builder add(T t)Here, t is the element to be added.Import the following package for the Stream.Builder class in Java:import java.util.stream.Stream;At first, create Stream.Builder:Stream.Builder builder = ... Read More

The accept() method in Java Stream.Builder

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

1K+ Views

Add an element to the stream using the accept() method of Java Stream.Builder.The following is the syntax:void accept(T t)Here, t is the argument to be inserted.Import the following package for the Stream.Builder class in Java:import java.util.stream.Stream;First, declare a Stream.Builder:Stream.Builder builder = Stream.builder();Now, use the accept() method:builder.accept("Demo"); builder.accept("Text");The following is an ... Read More

Java Program to adjust LocalDate to last Day of Year with TemporalAdjusters class

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

819 Views

Let us first set a date:LocalDate localDate = LocalDate.of(2019, Month.FEBRUARY, 11);Now, adjust LocalDate to last Day of year:LocalDate day = localDate.with(TemporalAdjusters.lastDayOfYear());Exampleimport java.time.LocalDate; import java.time.Month; import java.time.temporal.TemporalAdjusters; public class Demo {    public static void main(String[] args) {       LocalDate localDate = LocalDate.of(2019, Month.FEBRUARY, 11);       System.out.println("Current ... Read More

Java Program to adjust LocalDate to next Tuesday with TemporalAdjusters class

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

147 Views

At first, set a LocalDate:LocalDate localDate = LocalDate.of(2019, Month.FEBRUARY, 2);Now, adjust the LocalDate to next Tuesday using next() method:LocalDate date = localDate.with(TemporalAdjusters.next(DayOfWeek.TUESDAY));Exampleimport java.time.DayOfWeek; import java.time.LocalDate; import java.time.Month; import java.time.temporal.TemporalAdjusters; public class Demo {    public static void main(String[] args) {       LocalDate localDate = LocalDate.of(2019, Month.FEBRUARY, 2);   ... Read More

The build() method in Java LongStream.Builder

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

162 Views

The build() method of the LongStream.Builder class builds the stream and returns the built stream. The following is the syntax:LongStream build()Import the following package for the LongStream.Builder class in Java:import java.util.stream.LongStream;Declare a LongStream.Builder and add elements:LongStream.Builder builder = LongStream.builder(); builder.add(24000L); builder.add(47470L); builder.add(12999L);Now, use the build() method to build the ... Read More

I/O-mapped I/O in 8085 Microprocessor

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

4K+ Views

Generally, a processor like 8085, to address one I/O port by sending out 8-bit port address and IO/M* = 1. For example, let us say, the chip select pin of an I/O port chip is activated when 8-bit address = F0H, IO/M* = 1, and RD* = 0. This is ... Read More

MonthDay compareTo() method in Java

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

165 Views

Two MonthDay objects can be compared using the compareTo() method in the MonthDay class in Java. This method requires a single parameter i.e. the MonthDay object to be compared.If the first MonthDay object is greater than the second MonthDay object it returns a positive number, if the first MonthDay object ... Read More

MonthDay format() method in Java

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

113 Views

The MonthDay can be formatted with the specified formatter using the format() method in the MonthDay class in Java. This method requires a single parameter i.e. the MonthDay object to be formatted and it returns the formatted MonthDay with the specified formatter.A program that demonstrates this is given as followsExample Live ... Read More

Advertisements