Search This Blog

Saturday, July 5, 2025

Java String API - 2

 What is the output of the following code? 

(Hint: CharSequence is an interface.)



Created by Nancy K.A.N.

@12:10 05-Jul-2025

Follow on YouTube Coding With Nancy


Friday, July 4, 2025

Java Behavioral Design Patterns

Behavioral patterns in Java address object communication. Using behavioral patterns, you can define the interaction and communication among objects as well as between objects and the user. For example, you can use behavioral design patterns to distribute responsibilities or a chain of command. Which of the following are behavioral patterns?

a) Command pattern

b) Observer pattern

c) Singleton pattern

d) Factory pattern

e) Facade pattern


Created by Nancy K.A.N.

@14:14 04-Jul-2025

Follow on YouTube

https://kannancy.blogspot.com/

Wednesday, July 2, 2025

Java Variables - 1

 Which of the following are invalid variable names in Java?

a) !

b) $

c) _$

d) _


Created by Nancy K.A.N.

@23:09 02-Jul-2025

Follow on YouTube

https://kannancy.blogspot.com/

Tuesday, July 1, 2025

Java String API - 1

 Which of the following methods is used to convert a Java String to an array of characters?

a) split()

b) getChars()

c) getBytes()

d) toCharArray()


Created by Nancy K.A.N.

@23:05 01-Jul-2025

Follow on YouTube

https://kannancy.blogspot.com/

Monday, June 30, 2025

Java Variables - 1

Which of the following are not local variables?

a) Variables declared in a method

b)  Variables declared in a block inside a method

c) Non-static variables declared in a class

d) Variables as method arguments

e) Static variables declared in a class


Created by Nancy K.A.N.

@21:29 30-Jun-2025

Follow on YouTube

https://kannancy.blogspot.com/

Sunday, June 29, 2025

Java Exceptions - 1

 Which of the following keywords are not related to Java exceptions?

a) try

b) throw

c) catch

d) final

e) finally

f) catches

g) throws


Created by Nancy K.A.N.

@22:24 29-Jun-2025

Follow on YouTube

https://kannancy.blogspot.com/

Saturday, June 28, 2025

Java Unchecked Exceptions

 Which of the following are Java unchecked exceptions?

a) InterruptedException

b) ArithmeticException

c) NullPointerException

d) SQLException

e) ClassNotFoundException


Created by Nancy K.A.N.

@22:14 28-Jun-2025

Follow on YouTube

https://kannancy.blogspot.com/