Aatul Palandurkar

Posts Tagged ‘Java Training in Nagpur

Objectives:

  • How to use switch case in Java?
  • How to use switch case with string in Java?
  • How to pass string literals in switch case in Java?

 

Source Code:


public class SwitchWithStringExample

{
public static void main(String[] args)
{
String str = "two";
switch(str)
{
case "one":
System.out.println("one");
break;
case "two":
System.out.println("two");
break;
case "three":
System.out.println("three");
break;
default:
System.out.println("no match");
} // switch close
} // main close
} // class close

 

Steps to run above Java code:

Consider that we have saved code at C drive (c:\>) and the file is saved as SwitchWithStringExample.java

  1. Compilation : c:\> javac SwitchWithStringExample.java
  2. Interpretation : c:\> java SwitchWithStringExample

 

Output:

two

 

We conduct Java Training and Workshop for Corporates and College Students, if interested, please write to us on kloudsancyber@gmail.com

 

Aatul Palandurkar
International Trainer, and Author, NetBeans Dream Team Member

https://www.facebook.com/aatulpalandurkar
https://www.instagram.com/aatulpalandurkar/

Oracle Java Certifications For You

The Java programming language is among the most widely used software development platforms in the IT industry nowadays. It is extensively being used and appreciated by individuals as well as organizations to transform their innovative ideas into working software solutions.

 

The Java programming language is among the most widely used software development platforms in the IT industry nowadays. It is extensively being used and appreciated by individuals as well as organizations to transform their innovative ideas into working software solutions.

 

Oracle Corporation is constantly working in the area of Java platform development. They provide Java certifications as well. Each of these java certifications verifies a certain level of expertise and knowledge of the Java platform belonging to specific domains.

 

Adding the best Java certification to your resume will help you grab the attention of the employer. A Java certification can validate your knowledge and expertise in working with Java. Preparing for a Java Certification can help you enhance your Java programming skills.

 

Oracle Java Certifications

 

Before diving in detail into the various Java certification courses offered by the Oracle Corporation, let’s first skim through a summarized introduction. Oracle Java certifications are categorized as follows:

 

Entry Level

  • Oracle Certified Associate Java Programmer (OCAJP)

 

Professional Level

  • Oracle Certified Professional Java Programmer (OCPJP)
  • Oracle Certified Professional Java Application Developer (OCPJAD)

 

Master/Architect Level

  • Oracle Certified Master Java Enterprise Architect (OCMJEA)

 

 

The Oracle OCP Java SE 8 Programmer I certification will validate your strong Java programming skills. To earn this certification you will have to pass the 1Z0-808 exam. The 1Z0-808 exam objectives include topics such as Java basics, Java data types, array, loop contracts, methods and encapsulation and so on.

 

 

 

The Oracle OCP Java SE 8 Programmer II certification is a professional-level certification designed to validate the foundation skills of database administration. The OCP 1Z0-809 exam objectives include exceptions and assertions; generics and collections; Java Class Design, Java File I/O (NIO.2), Java I/O Fundamentals, Java Stream API, and localization.

 

 

 

Oracle OCP Java SE 11 Developer certification covers a wide range of available Java 11 programming concepts. To earn this certification you will have to clear the 1Z0-815 exam. The Oracle 1Z0-815 exam covers topics such as Encapsulation, creating and using methods; creating simple Java programs, describing and using objects and classes; handling exceptions, Java technology, reusing implementations through Inheritance, 

understanding modules, and more.

As we all know that Java is employed for developing a wide array of applications. This programming language is used in creating server-side applications to mobile applications. So, if you are thinking about starting your career in this field, then you must consider these certifications. We offer courses that will help you prepare for the certification exams.

 

Pattern 3 :

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1

 

Java Code for above pattern :


import java.util.Scanner;

 

public class Pattern3

{

public static void main(String[] args)

{

Scanner sc = new Scanner(System.in);

//Taking rows value from the user

System.out.println("How many rows you want in this pattern?");

int rows = sc.nextInt();

System.out.println("Here is your pattern....!!!");

//Printing upper half of the pattern

for (int i = 1; i <= rows; i++)

{

for (int j = 1; j <= i; j++)

{

System.out.print(j+" ");

}

System.out.println();

}

//Printing lower half of the pattern

for (int i = rows-1; i >= 1; i--)

{

for (int j = 1; j <= i; j++)

{

System.out.print(j+" ");

}

System.out.println();

}

//Closing the resources

sc.close();

}

}

Output :

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1

 

Q. Write a Java program to print given pattern.

Pattern 1 :

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
1 2 3 4 5 6 7

 

Java Program:


import java.util.Scanner;

public class MainClass

{

public static void main(String[] args)

{

Scanner sc = new Scanner(System.in);

//Taking rows value from the user

System.out.println("How many rows you want in this pattern?");

int rows = sc.nextInt();

System.out.println("Here is your pattern....!!!");

for (int i = 1; i <= rows; i++)

{

for (int j = 1; j <= i; j++)

{

System.out.print(j+" ");

}

System.out.println();

}

//Close the resources

sc.close();

}

}


Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 13,225 other followers

Tweets

YouTube

Archives

%d bloggers like this: