Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class HWarray1 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner sc = new Scanner(System.in);
- String s = "fpefiajpfjei";
- System.out.println(s.length());
- String a = "Happy";
- if (a.equals("Happy")) {
- System.out.println("YES");
- }
- int count = 0;
- String b = "npadnoawnd";
- for(int i = 0; i<b.length(); i++) {
- if(b.charAt(i)=="A") {
- count++;
- }
- }
- System.out.println(count);
- int count1 = 0;
- String c = "nosnoanncd";
- for(int i = 0; i<c.length(); i++) {
- if(c.charAt(i)=="c") {
- count1++;
- }
- }
- for(int i = 0; i<100; i++) {
- System.out.println("===");
- }
- for(int i = 0; i<5; i++) {
- System.out.println("++");
- }
- for(int i = 0; i<11; i++) {
- System.out.println("HI");
- }
- for(int i = 0; i<10; i++) {
- System.out.println("Yummy");
- }
- for(int i = 0; i<23; i++) {
- System.out.println("Bruce");
- }
- for(int i = 0; i<30; i+=5) {
- System.out.println(i);
- }
- for(int i = 1; i<5; i++) {
- System.out.println(i);
- }
- String S = "afiewonvnos";
- for(int i = 0; i<s.length(); i++) {
- System.out.println(s.charAt(i));
- }
- for(int i = s.length()-1; i>=0; i--) {
- System.out.println(s.charAt(i));
- }
- for(int i = 1; i<7; i+=2) {
- for(int j = 2; j<8; j+=2) {
- System.out.println(i+" "+j);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement